The world of containers shifts rapidly. At the time of writing the former recommended method of running Docker on OSX - using the boot2docker CLI to configure a Virtual Box provisioned Linux VM that runs the Docker host - appears to be set to be deprecated. Its replacement is a new CLI called Docker Machine that offers the same functionality as boot2docker, but adds the ability to create and control multiple Docker hosts on a wide variety of providers - such as AWS EC2 instances or DigitalOcean droplets - and to allow these to be used interchangably with the local Docker client.
This is a quick guide on how to get Docker Machine running on OSX, but more importantly how to get a Virtual Box provisioned Docker host running at startup.
Install latest Docker Machine, Docker & Virtual Box
Create a local Docker host using the Virtual Box driver
If you installed Docker & Docker Machine with Docker Toolkit, this step can be achieved by running the Docker Quickstart Terminal.
Load the local Docker host settings into your environment
or .bashrc or .zshrc or whatever else you use.
Create a plist file to start the local Docker host
Put this file in
Update the entry
/usr/local/bin/docker-machine in the plist with the value of the following command if it’s different on your system. This should only be the case if you didn’t use brew, or use a non-standard brew installation dir. If this applies to you, make sure the PATH value reflects your PATH as
docker-machine attempts to invoke
VBoxManage which will need to be available on one of those paths.
Use launchctl to load the plist file into launchd
Alternate Ending for the lazy
This gist provides a way to do the last two steps without having to do any text editing yourself.