gcloud docker push 403 Forbidden

前端 未结 2 1143
长发绾君心
长发绾君心 2021-01-18 09:01

I am trying to push a docker image to eu.gcr.io and I am getting 403 Forbidden

gcloud docker push  eu.gcr.io//:latest                


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 09:18

    I had faced the same issue, to resolve it in order I done.

    1. Rename the images as told
    2. Add the user to docker group (important for the docker login)
    3. Use docker login token https://cloud.google.com/container-registry/docs/auth
    docker login -e 1234@5678.com -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

提交回复
热议问题