Upgrade Docker to Master on OSx

Docker is a fast moving project enjoying a lot of popularity among developers across all branches. With this wide support the Docker ecosystem is evolving almost every day reaching from Deis as a PaaS platform, cluster management in CoreOS and Kubernets. Even Microsoft is considering Docker support for their next version of Microsoft Server. In this post I would like to demonstrate how to upgrade to a master release of Docker running on Mac OSx with Boot2Docker which comes handy when trying to keep up with the latest development or move a around a current bug already fixed in a new release. Likely the here stated notes will also be useful with other environments.

Upgrading Docker Client

Upgrading docker to a recent master version is straight forward. We first need to download the wanted docker binary. In our case we are aiming to install the current master branch which can be found here. After downloading we’ll replace the existing docker binary be linking to the downloaded one Here is how to do it:

After the above commands the client should successfully be updated. This can be verified by running docker version. When doing so you should see an output similar to this:

With this output you can see that the client was successfully update to 1.8.0-dev. What this output also tells you is that the server (docker daemon) not yet has been updated correctly. We will do this next using Boot2Docker.

Upgrading Docker Server (Boot2Docker)

Updating the docker daemon is basically the same as the client as you only have to change the existing binary. Starting the docker daemon over the init script is almost the same as running docker -d. But running the docker daemon is not supported on all OS incl. OSx. Therefor most of the time the daemon is executed on VM running locally on OSx. Updating the daemon there is still the same with the exception that we have to make the changes permanent by making them resistant to restart.

This now has also updated the running docker daemon on Boot2Docker. By placing the docker binary in /var/lib/boot2docker the file will also be available after a restart. But will also the linking of packages be available as well? The answer to this is now. So take make the changes permanent after restart we will still have to do the linking. With Boot2Docker this can be achieved by placing a script inside of file named bootlocal.sh also placed under /var/lib/boot2docker. Here is what the content of this script could look like:

After a chmod 755 /var/lib/boot2docker/bootlocal.sh restart of Boot2Docker we should see the following when running docker version form the OSx host:

We now have successfully updated our Docker installation.

Further Reading

2 thoughts on “Upgrade Docker to Master on OSx”

Leave a Reply