EDIT: Homebrew now contains docker. Just
brew install docker away .... You may still need/want to forwards ports and stuff like that.
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:
$ mkdir tmp $ export GOPATH=`pwd`/tmp $ go get -v github.com/dotcloud/docker/docker # (this may take some time) $ sudo cp tmp/bin/docker /usr/local/bin/ $ rm -rf tmp
If you now run your new
docker</code> command, you should get an error about docker being unable to connect to a socket at /var/run/docker.sock</code>:
$ docker version Go version (client): go1.1.1 2013/09/09 15:04:07 dial unix /var/run/docker.sock: no such file or directory
The problem is obvious: you don't have a local docker daemon running.
I assume you followed the vagrant guide at <a title="Docker Installation Guide using Vagrant" href="http://docs.docker.io/en/latest/installation/vagrant/" target="_blank">docker.io</a> 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.
Vagrantfile</code> and add the following line inside the Vagrant::Config.run</code> block (e.g. before the end in <a href="https://github.com/dotcloud/docker/blob/master/Vagrantfile#L44" target="new">line 44</a>): config.vm.forwardport 4243, 4243</code> (My Vagrantfile).
Inside the VM, edit the
/etc/init/dockerfile and add the argument
-H tcp://0.0.0.0:4243</code>, 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):
$ docker version Go version (client): go1.1.1 Server version: 0.6.1 Git commit (server): 5105263 Go version (server): go1.1.2
Done! You are good to go. Have fun with Docker!
<b>!!! 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. !!!</b>