Im trying to pass a secret into a Cloud Run run command. The secret is a json file. I want to pass it in as an environment variable.
It works great in docker using:
docker run -it -e "SECRET_ENV=$(<path/secretFile.json)" -p 8080:8080 my_image
When I use the same method on gcloud I get an error that tells me its trying to run each line of the json file:
gcloud run deploy --image gcr.io/account/project --update-env-vars "SECRET_JSON=$(<path/secretFile.json)"
cheers
Currently gcloud run deploy
doesn't support setting environment variables through a json file. More information about environment variables on Cloud Run can be found here.
You may want to file a Feature Request for this improvement.
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