I currently have set up docker compose on digital ocean and would like to try out gcplogs (Google Cloud Logging driver). As I understand it I need to set my Google Application Default Credentials by downloading a json keyfile and setting GOOGLE_APPLICATION_CREDENTIALS
to point to it.
This is how I have set this up (without it working)
version: "2"
services:
containername:
build: /whatever/containername
environment:
- GOOGLE_APPLICATION_CREDENTIALS=/usr/src/app/project-12349aba.json
logging:
driver: gcplogs
options:
env: test
gcp-project: my-project-name
This gives me the following error:
ERROR: for containername Failed to initialize logging driver: google.DefaultTokenSource: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
What am I missing? What am I doing wrong?
I am positive that the credential-file works and is at that location because I use it inside the app with the ruby google/cloud
gem with success. I am also capable of using that ruby-gem to log successfully, but I would really like to get this working on the docker container so I can re-use it on other non-ruby projects.