Docker Community Forums

Share and learn in the Docker community.

GCP Logging and Docker

I’m trying to follow the guidelines setup here:

I created a new project in GCP, I enabled billing, I created a service account and granted it the role of Owner and a different service with the RoleWriter role.

It doesn’t matter which role i try to use, i also have the following

/etc/systemd/system/docker.service.d/docker-service-override.conf

[Service]
Environment="GOOGLE_APPLICATION_CREDENTIALS=/home/samir/management-credentials.json"

sudo systemctl daemon-reload && sudo systemctl restart docker

Now, in order to test this i run the following:

docker run -d --log-driver=gcplogs --log-opt gcp-project=docker-test hello-world
06cbf4242338d3c642dce4db51925da967e6eaf39c56c1d8aff66b53c6302820
docker: Error response from daemon: failed to initialize logging driver: unable to connect or authenticate with Google Cloud Logging: rpc error: code = PermissionDenied desc = The caller does not have permission.

What am I missing ?

Configure Vector
Copy
cat <<-VECTORCFG > /etc/vector/vector.toml
[sources.in]
type = “docker” # required

[sinks.out]
inputs = [“in”] # required
log_id = “vector-logs” # required
project_id = “vector-123456” # required
type = “gcp_stackdriver_logs” # required
VECTORCFG
explain this command
#Start the Vector container
docker run
-v $PWD/vector.toml:/etc/vector/vector.toml:ro
-v /var/run/docker.sock:/var/run/docker.sock
timberio/vector:latest-alpine
explain this command
That’s it! Simple and to the point. Hit ctrl+c to exit.

That doesn’t quiet answer my question, but… Vector looks bad ass. Thanks for the link.

For reference: https://vector.dev/docs/about/what-is-vector/

I am facing the same error in gcp.