OSX Yosemite and Cisco AnyConnect tcp timeout can’t connect to Docker

Found the answer here: http://stackoverflow.com/a/27804765/1518121 THANK YOU!

The scenario is you’ll see error like this one trying to work with a docker container:

FATA[0000] Get http:///var/run/docker.sock/v1.16/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

I am using OSX Yosemite and Cisco Anyconnect (which are apparently a bad combo for using boot2docker) and the following finally worked for me (thanks to the linked GitHub issue comment):

These steps will add a port forwarding rule and modify your environment to have docker point to (instead of or other NATed IP).

First – boot2docker needs to be installed but not running.

If it is currently running – stop it now:

boot2docker down
Add a rule to forward traffic from to port 2376 on the boot2docker vm:

vboxmanage modifyvm “boot2docker-vm” –natpf1 “docker,tcp,,2376,,2376”
Start boot2docker:

boot2docker up
Set default DOCKER environment variables:

$(boot2docker shellinit)
Override the DOCKER_HOST variable to point to

export DOCKER_HOST=tcp://
Now you should be able to run docker commands:

docker version

Facebook comments: