Search code examples
dockergoogle-cloud-platformgoogle-container-registrygoogle-cloud-iam

Can't push image to google container registry - Caller does not have permission 'storage.buckets.get'


I am working on a bitbucket pipeline for pushing image to gc container registry. I have created a service account with Storage Admin role. ([email protected])

enter image description here

gcloud auth activate-service-account --key-file key.json
gcloud config set project mgcp-xxxx
gcloud auth configure-docker --quiet
docker push eu.gcr.io/mgcp-xxxx/image-name

Although that the login is successful, i get: Token exchange failed for project 'mgcp-xxxx'. Caller does not have permission 'storage.buckets.get'. To configure permissions, follow instructions at: https://cloud.google.com/container-registry/docs/access-control

Can anyone advice on what i am missing?

Thanks!


Solution

  • In the past I had another service account with same name and different permissions. After discovering that service account names are cached, I created a new service account with different name and it's pushing properly.