Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Push to Google Container Registry (unable to access the repository)

Whenever I attempt to push a container to the Google Container Registry from my local machine, I get the following error:

denied: Unable to access the repository; please check that you have permission to access it.

If I open the Cloud Shell, I can push containers with no problems. I have tried doing "gcloud auth login" several times and it seems to make no difference. I don't have any problems running other gcloud commands locally. Any help would be greatly appreciated.

like image 857
Dale Alleshouse Avatar asked Sep 01 '16 17:09

Dale Alleshouse


2 Answers

FYI for other customers running into similar issues: https://github.com/docker/docker/issues/22910

There exists a bug with current versions of the Docker client (1.11, 1.12), and the default credential stores which are being enabled on new installations, which break private registries. Removing the

"credsStore": "whatever"

field from your docker config (e.g. ~/.docker/config.json) and running

gcloud docker ...

should fix the issue.

Update:

Alternately, we've implemented a credential helper of our own which solves the problem for our customers (i.e. doesn't get tripped up by the lack of a scheme in the GCR URLs that the Docker client uses to request credentials). To install the credential helper:

  • Download the helper binary and put it on your PATH
    • gcloud components install docker-credential-gcr or
    • download/compile the binary from GitHub
  • Execute docker-credential-gcr configure-docker to configure to the Docker client
like image 136
jsand Avatar answered Oct 29 '22 12:10

jsand


Have you run gcloud auth login?

like image 2
Lizhu Qi Avatar answered Oct 29 '22 12:10

Lizhu Qi