The newer versions of docker (currently 0.6.2) no longer have a Makefile to build the current version, so the way to a local docker binary for Mac OS X wasn’t obvious for me. But it ain’t that hard:
If you now run your new
docker command, you should get an error about docker being unable to connect to a socket at
The problem is obvious: you don’t have a local docker daemon running.
I assume you followed the vagrant guide at docker.io and have your VirtualBox VM with docker running. We need to modify this VM a bit, so our local docker client can reach the docker server inside it.
- Modify the
Vagrantfileand add the following line inside the
Vagrant::Config.runblock (e.g. before the end in line 44):
config.vm.forward_port 4243, 4243(My Vagrantfile).
- Inside the VM, edit the
/etc/init/dockerfile and add the argument
-H tcp://0.0.0.0:4243, so the daemon listens on all network devices.
- Now reboot the VM with
vagrant reload(in your docker project folder), so both previous changes take effect.
- In your local shell, alias the docker command to use the network as well:
alias docker='docker -H tcp://127.0.0.1:4243/'. You may want to add this line to you
.bashrcor something similar.
When you now enter
docker version you should see something like this (note the server version):
Done! You are good to go. Have fun with Docker!
!!! A word of warning: This changes allows anyone to send your docker daemon commands and control it! You should make sure the VM is only reachable from your local machine. !!!
(This was also posted on Coderwall.com)