Access to the Google Container registry is denied when clicking on the docker container

I am trying to pull my docker container into google container registry using this tutorial , but when I run

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

I get an error message:

 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 could no longer find explanations (no -D, -debug, -verbose arguments were recognized), gcloud auth list and docker info tell me that I am connected to both services.

Anything I miss?

+7
docker google-cloud-platform gcloud google-container-registry
source share
7 answers

For me, I forgot to add gcloud to the string (and I was wondering how docker would be authenticated):

 $ gcloud docker push <image> 
+3
source share

I see this, but on an intermittent basis. For example, I can get an error in the error: Permission denied for the "last" from the request "/ v2 / ....", but if you try again it will work.

Does anyone else experience this?

+3
source share

Use gsutil to check the ACL to make sure you have write permission to the bucket:

 $ gsutil acl get gs://<my-bucket> 

You will need to check in which group the account is used ("owners", "editors", "viewers", etc.).

EDIT . I recently experienced a very similar problem with this, and as @lampis notes in his post, this is because the correct permission areas were not set when I created the virtual machine that I was trying to push the image. Unfortunately, there is currently no way to change the scope when creating a virtual machine, so you need to delete the virtual machine (make sure the drives are set to automatically delete!) And recreate the virtual machine with the correct areas ('compute-rw', 'storage- rw 'seems sufficient). It does not take much time, though :-).

See the --scopes section here: https://cloud.google.com/sdk/gcloud/reference/compute/instances/create

+2
source share

If you are using Docker 1.7.0, there has been a change in the way they handle authentication, which affects users who use a combination of gcloud docker and docker login .

Make sure you use the latest version of gcloud through: gcloud components update .

So far this affects gcloud docker , docker-compose and other tools that read / write the Docker authorization file.

Hope this helps.

+1
source share

Same issue here, the troubleshooting section https://cloud.google.com/tools/container-registry/#access_denied didn't help much. I have Docker and GCloud completely updated. I don’t know what else to do.

By the way, I'm trying to click "gcr.io".

Fixed. I used VM in a computing engine as my development machine and looked like I was not giving it enough resources in Storage.

+1
source share

I had the same denied access problem and I decided to create a new image using Tag :

 docker tag IMAGE_WITH_ACCESS_DENIED gcr.io/my-project/my-new-image:test 

After that, I was able to PUSH to the Container Registry:

 gcloud docker -- push gcr.io/my-project/my-new-image:test 
+1
source share

When you create an instance of the Google Virtual Machine, make sure that it has sufficient access rights.

Option 1

In the Identifier and API Access section, select Allow full access to all cloud APIs.

enter image description here

Option 2 (recommended)

In the "Identification" and "Access to API" section, select "Set access for each API", and then "Read the record for storage."

enter image description here

0
source share

All Articles