I am trying to push a docker image to eu.gcr.io and I am getting 403 Forbidden
gcloud docker push eu.gcr.io/<projectname>/<image>:latest
The push refers to a repository [eu.gcr.io/<projectname>/<image>] (len: 1)
663cd9de01fe: Preparing
Post https://eu.gcr.io/v2/w<projectname>/<image>/blobs/uploads/: token auth attempt for registry: https://eu.gcr.io/v2/token?account=_token&scope=repository%3A<projectname>%2F<image>3Apush%2Cpull&service=eu.gcr.io request failed with status: 403 Forbidden
I have checked
I had faced the same issue, to resolve it in order I done.
docker login -e [email protected] -u _token -p "$(gcloud auth print-access-token)" https://gcr.io
(If using sudo docker
, the token will be stored with the root account.)
Then use docker push gcr.io/projetc_id/imagename
according to How to push a docker image to a private repository
Looks like the problem is that the (local) docker tag was incorrect, the tag was the "project name" instead of "gcloud project id" so by changing the tag to contain the project the push works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With