0

So I'm trying to push my docker image to gcr.io/docker-url, but it's not working. I've tried the documentation that Google has, but that's still failed (https://cloud.google.com/container-registry/docs/advanced-authentication#standalone_docker_credential_helper). I also tried:

docker login gcr.io 

and

docker login us.gcr.io

Here's the command I run and my error:

docker push gcr.io/docker-url/jenkins/container
The push refers to repository [gcr.io/docker-url/jenkins/container]
d7ab52d2e8be: Pushing [==================================================>]   2.56kB
fae569eb21a4: Pushing  1.536kB
7a20d9096c74: Pushing [====>                                              ]  735.7kB/7.854MB
a26d457fd72d: Pushing [>                                                  ]  60.93kB/6.055MB
36f2fac55108: Pushing [>                                                  ]  502.8kB/49.16MB
4cd936335289: Waiting 
f1b5933fe4b5: Waiting 
denied: Access denied.

For reference, I used the json file to login. I even tried all of the StackOverflow answers I could find, but no luck there, either.

  • Does your user (or service account) have such permissions to write on Google Container Registry? .... I use to run the following command to authenticate for push/pull images: docker login -u oauth2accesstoken -p "$(gcloud auth print-access-token)" https://gcr.io – manasouza Jun 21 at 20:16
1

In case anyone else is running into this issue and can't figure it out, I fixed it by running this command:

gcloud auth activate-service-account --key-file key-file.json

And then ran my docker push command and it pushed through.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.