Search code examples
dockergcloudgoogle-kubernetes-enginegoogle-container-registry

gcloud docker push hanging


When I try to push new docker images to gcr.io using gcloud docker push, it frequently makes some progress before stalling out:

$ gcloud docker push gcr.io/foo-bar-1225/baz-quux:2016-03-23
The push refers to a repository [gcr.io/foo-bar-1225/baz-quux]
762ab2ceaa70: Pushing [>                                              ]   556 kB/154.4 MB
2220ee6c7534: Pushing [===>                                           ]  4.82 MB/66.11 MB
f99917176817: Layer already exists
8c1b4a49167b: Layer already exists
5f70bf18a086: Layer already exists
1967867932fe: Layer already exists
6b4fab929601: Layer already exists
550f16cd8ed1: Layer already exists
44267ec3aa94: Layer already exists
bd750002938c: Layer already exists
917c0fc99b35: Layer already exists

The push stays in this state indefinitely (I've left it for an hour without a byte of progress). If I Ctrl-C kill this process and rerun it, it gets to the exact same point and again makes no progress.

The only workaround I've found is to restart my computer and re-run "Docker Quickstart Terminal". Then the push succeeds.

Is there a workaround for stalled pushes that doesn't require frequently rebooting my computer? (I'm on Mac OS X.)


Solution

  • This seems to be an issue to docker users on Mac have ran into previously, as can be seen in this docker thread, https://github.com/docker/docker/issues/5113

    While there is no clear fix, a slightly better workaround is to restart docker machine rather than your computer each time.

    You can run docker-machine restart default to reset docker to a working state.

    Hope that helps.