I'm trying to pass a .json
file into a Docker container at runtime but it keeps saying that keys.json was not found
. I need to pass the .json
file for Google Cloud's: GOOGLE_APPLICATION_CREDENTIALS
After I built the image, I have tried the following commands to no avail:
pwd = /Users/{username}/Desktop/football-data
docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=keys.json \
-v $GOOGLE_APPLICATION_CREDENTIALS:keys.json:ro \
{image_name}:1.0
docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=./keys.json \
-v $GOOGLE_APPLICATION_CREDENTIALS:keys.json:ro \
{image_name}:1.0
with absolute path as well:
docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=/Users/{username}/Desktop/football-data/keys.json \
-v $GOOGLE_APPLICATION_CREDENTIALS:keys.json:ro \
{image_name}:1.0
both error out and say:
google.auth.exceptions.DefaultCredentialsError: File keys.json was not found.
I'm running this command from the directory in which the image was built and keys.json
is in the pwd