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.
Your credentials are stored at ~/. config/gcloud .
Application Default Credentials (ADC) ADC is a strategy used by Cloud Client Libraries and Google API Client Libraries to automatically find credentials based on the application environment, and use those credentials to authenticate to Google Cloud APIs.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With