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!

ajmurmann
  • 439
  • 1
  • 7
  • 8

4 Answers4

63

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

beta
  • 115
  • 6
  • 17
    And since it's worth a killoword: [a screenshot of how to implement](http://imgur.com/a/665d6) – hamx0r Jul 04 '17 at 04: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.

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.
jsand
  • 151
  • 4
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.