Search code examples
google-container-registry

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.


Solution

  • 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
    • Execute docker-credential-gcr configure-docker to configure to the Docker client