25

I am trying to push a docker image to Google's container registry but keep getting a error about Docker login having failed. I run

gcloud docker -- push gcr.io/<my-project-id>/test-image

I get back

ERROR: Docker CLI operation failed:

Error response from daemon: login attempt to 
https://appengine.gcr.io/v2/ failed with status: 404 Not Found

ERROR: (gcloud.docker) Docker login failed.

Other gcloud operations that don't go through docker work. I can for example create a cluster via gcloud container clusters create my-cluster.

I did play around with a local registry today, not sure if that might have broken things.

Thanks!

63

You just need to disable storing docker credentials on macOS keychain on preferences of Docker for Mac.

| improve this answer | |
  • 17
    And since it's worth a killoword: a screenshot of how to implement – hamx0r Jul 4 '17 at 4:55
  • gcloud docker commands were working fine for me all last night. Then sometime today (7/18/17) I did a docker client update and the commands stopped working. Search let me here and this answer fixed the issue. – eggie5 Jul 18 '17 at 21:29
  • you saved my day! Why would anyone rollout such updates?.. Bizzare. – Ufos Jul 21 '17 at 14:18
8

Edit: It seems my approach works only temporarily. Thanks to @hamx0r for posting a screenshot of how to apply the long-term fix.


Disable storing docker credentials on mac os x keychain by removing this entry from your ~/.docker/config.json file.

    "credsStore": "osxkeychain",

In my case, I had no additional configuration (I wasn't logged in), so I just blanked the entire file.

| improve this answer | |
  • this worked to fix it for me as of July 11, 2017 – sgammon Jul 11 '17 at 16:45
  • 2
    It seems my approach works only temporarily. Thanks to @hamx0r for posting a screenshot of how to apply the long-term fix. – Edward Anderson Jul 11 '17 at 17:15
5

An update should be available in Google Cloud SDK v164.0.0 to fix this issue, sorry for the trouble.

Now would probably be a good time to advertise the newest, hottest authentication method in town: docker-credential-gcr

Edit: v164.0.0 has been released:

Breaking Changes

  • Removed appengine.gcr.io from the list of default repositories that gcloud docker authenticates for.
| improve this answer | |
3

I had the same problem. I was using Docker for Mac from Edge channel (see difference https://docs.docker.com/docker-for-mac/install/). After switching to Stable (BEWARE, you lose all your images, containers, volumes, configs), I can push images to Google Container Registry again.

| improve this answer | |
  • 15
    As of June 28th, the stable branch has this issue as well. This answer is no longer correct, alas. – Symmetric Jun 29 '17 at 0:11

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.