Reputation: 361
Is there a way of passing my local google default application credentials (https://developers.google.com/identity/protocols/application-default-credentials) via docker run?
My usecase:
It would be nice if I could tell "docker run" to pass the host google default application credentials to the docker image.
Upvotes: 34
Views: 15718
Reputation: 3129
Passing -v ~/.config:/root/.config
should make it work. This assumes that your local code uses application default credentials stored by gcloud auth login
in ~/.config/gcloud and that the user's home directory in the container is /root.
Upvotes: 45