Google Container Registry access denied when pushi

2019-01-26 10:06发布

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 ?

9条回答
相关推荐>>
2楼-- · 2019-01-26 10:32

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

查看更多
迷人小祖宗
3楼-- · 2019-01-26 10:42

For me I forgot to prepend gcloud in the line (and I was wondering how docker would authenticate):

$ gcloud docker push <image>
查看更多
看我几分像从前
4楼-- · 2019-01-26 10:44

Same problem here, the troubleshooting section from https://cloud.google.com/tools/container-registry/#access_denied wasn't very helpful. I have Docker and GCloud full updated. Don't know what else to do.

BTW, I'm trying to push to "gcr.io".

Fixed. I was using a VM in compute engine as my development machine, and looks like I didn't give it enough rigths in Storage.

查看更多
登录 后发表回答