Docker server in VM not responding - docker, docker-compose client comands hang

Issue

Occasionaly, docker for mac will get in to a state where docker-compose and docker commands will not receive an output.
docker commands result in an indefinite hang
docker-compose commands result in ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug info

Diagnosis

Seems like the docker and docker-compose clients are working, but the docker server is not responding. It also seems like this happens just following a docker-compose kill command, though that could be a coincidence.

Attempted resolution

Previously changing DNS servers (even though this is local docker) had a positive effect, though that could be a separate issue. In this instance restarting docker seems to have no positive effect, nor does changing network connections.
Seems there are some others having this issue with different thread titles. This is an attempt to consolidate those issues under a more explicit description:

Information

  • docker for mac 1.12.0-rc2-beta16 (build: 9493)
  • Diagnostic: 392F304D-E72C-494D-8622-F610CB366045
  • OS X 10.11.5

Output of docker-compose --verbose up:

compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Found 'auths' section
docker.auth.auth.parse_auth: Found entry (registry=u'quay.io', username=u'xxxxx')
docker.auth.auth.parse_auth: Found entry (registry=u'https://index.docker.io/v1/', username=u'xxxxxxx')
docker.auth.auth.load_config: Found 'HttpHeaders' section
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose/cli/main.py", line 58, in main
  File "compose/cli/main.py", line 106, in perform_command
  File "compose/cli/command.py", line 35, in project_from_options
  File "compose/cli/command.py", line 109, in get_project
  File "compose/cli/command.py", line 84, in get_client
  File "site-packages/docker/api/daemon.py", line 76, in version
  File "site-packages/docker/utils/decorators.py", line 47, in inner
  File "site-packages/docker/client.py", line 120, in _get
  File "site-packages/requests/sessions.py", line 477, in get
  File "site-packages/requests/sessions.py", line 465, in request
  File "site-packages/requests/sessions.py", line 573, in send
  File "site-packages/requests/adapters.py", line 433, in send
requests.exceptions.ReadTimeout: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
docker-compose returned -1

+1 having same exact issue/error - any way to fix other than reinstall completely? Restarting docker/computer didn’t work

It worked for me after connecting to a VPN in the USA. I am guessing this is a networking configuration issue somewhere between my country and the docker data center.