Google Container Registry access denied when pushing docker container

hilnius picture hilnius · Jul 6, 2015 · Viewed 13.6k times · Source

I try to push my docker container to the google container registry, using this tutorial, but when I run

gcloud docker push b.gcr.io/my-bucket/image-name

I get the error :

The push refers to a repository [b.gcr.io/my-bucket/my-image] (len: 1)
Sending image list
Error: Status 403 trying to push repository my-bucket/my-image: "Access denied."

I couldn't find any more explanation (no -D, --debug, --verbose arguments were recognized), gcloud auth list and docker info tell me I'm connected to both services.

Anything I'm missing ?

Answer

Yuchen Zhong picture Yuchen Zhong · May 22, 2017

When you create you Google Cloud VM instance, make sure it has the enough accessing right.

Option 1

Under the Identity and API access, select Allow full access to all Cloud APIs.

enter image description here

Option 2 (recommended)

Under the Identity and API access, select Set access for each API and then choose Read Write for Storage.

enter image description here