gcloud docker -- push results in login attempt failed with 404

Solution 1:

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

Solution 2:

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.

Solution 3:

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.

Solution 4:

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.