17

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.)

danvk
  • 15,863
  • 5
  • 72
  • 116

1 Answers1

21

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.

k4leung4
  • 261
  • 2
  • 3
  • 1
    Mostly as a reminder to myself, restarting docker-machine means that you lose all your locally cached images. Which makes this a pretty frustrating "fix" for a regular problem. – jwadsack Aug 08 '16 at 21:18
  • 4
    When using Docker for Mac, restarting Docker (menu bar) resolves the problem as well. – resamsel Aug 30 '16 at 08:57
  • 6
    On Linux, docker-machine doesn't seem to be installed by default, but running `sudo service docker restart` seems to do the job. – daoudc May 18 '17 at 07:25