This will automatically install Docker using Salt.
Docker will be automatically configured to accecept connections from anywhere which means
you can alias docker on OSX to talk directly with docker on the Vagrant virtual machine.
For this to work you need the following installed.
- VirtualBox
- Vagrant 1.1+
- Vagrant
vagrant-vbguestplugin:vagrant plugin install vagrant-vbguest - Vagrant
vagrant-saltplugin:vagrant plugin install vagrant-salt
Clone the repo and vagrant up && vagrant reload
We have to install docker on OSX, obviously it won't work as docker does not yet support OSX, however we
still need the docker binary so we can connect to docker running on Vagrant.
Install Go Using HomeBrew
brew update
brew install go
Follow these steps to install docker binary on OSX.
cd ~mkdir tmpexport GOPATH=`pwd`/tmpmkdir -p $GOPATH/src/github.com/dotcloudcd $GOPATH/src/github.com/dotcloudgit clone https://github.com/dotcloud/docker.gitcd $GOPATH/src/github.com/dotcloud/dockergit checkout v0.6.3go get -v github.com/dotcloud/docker/...sudo cp $GOPATH/bin/docker /usr/local/bincd ~ && rm -rf tmp
Now run docker version and you should see the following:
$ docker version
Go version (client): go1.1.2
2013/10/06 15:42:01 dial unix /var/run/docker.sock: no such file or directory
Seeing as we don't have docker running on OSX this is totally expected,
All we need to do now is just create an alias on OSX, add this to your ~/.bashrc
or ~/.zshrc etc.
alias docker='docker -H tcp://127.0.1:4243/'
Reload your shell and run docker version you should see the following output:
$ docker version
Go version (client): go1.1.2
Server version: 0.6.3
Git commit (server): b0a49a3
Go version (server): go1.1.2
Last stable version: 0.6.3
Now give docker run -i -t ubuntu /bin/bash a try ;)
Thanks to these articles: