I want to set GOOGLE_APPLICATION_CREDENTIALS inside my docker container using my key.json
file but I don't want to copy this file into my container.
docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/[FILE_NAME].json \
-v $GOOGLE_APPLICATION_CREDENTIALS:/tmp/keys/[FILE_NAME].json:ro \
gcr.io/[PROJECT_ID]/[IMAGE]
Ref: https://cloud.google.com/run/docs/testing/local
For anyone who is using a key file in the current working directory:
docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/[FILE_NAME].json \
-v $(pwd):/tmp/keys/[FILE_NAME].json:ro \
gcr.io/[PROJECT_ID]/[IMAGE]
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