So I have the gcloud docker image and want to use gcloud through the image, but I need to authenticate and I'm getting this error.
ERROR: (gcloud.auth.activate-service-account) Could not read json file credentials.json: Invalid control character
and these are the commands I'm using
echo -n "$GOOGLE_TOKEN" > /tmp/credentials.json
- cat /tmp/credentials.json
- gcloud auth activate-service-account --key-file=/tmp/credentials.json
and the service account json does work on other apps.
"echo" is not portable. In some cases it does \X escape processing by default. It depends on the system and/or shell variant and/or shell release. Use printf instead of "echo -n ...":
printf '%s' "$GOOGLE_TOKEN"
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