Say Hello to Docker for Mac

I got the really awesome opportunity to be the first external user of Docker for Mac back in January when it was in its Alpha stage.

Docker Toolbox was a huge step up from needing to download, install, and setup everything individually; however, I still had to deal with several moving parts. With Docker for Mac, all I had to do was run a single app and it just worked while having the same feel as running Docker directly in Linux. It was incredible being able to run Docker on a Mac without needing Virtual Box or Docker Machine to merely run Docker.

This meant no longer having to make sure I had an active machine in every new terminal. It additionally meant saying goodbye to the error “Error response from daemon: client is newer than server”.

The biggest thing to me though was not needing Virtual Box due to a corporate VPN. With Virtual Box I had come across a slew of problems and they never seemed to fully go away. I lost track of how many hours I spent fiddling with it or being best friends with Stack Overflow. Was my issue because of Docker or because of Virtual Box? I was very new to using both. Initially, I could not get Docker to work (it complained about a TCP timeout) at all unless I forwarded traffic through and overrode my DOCKER_HOST environment variable. But then I couldn’t get any static sites to work (e.g. NGINX). I got the sad paper in Chrome and it telling me that the site couldn’t be reached. After wiping out and restarting everything, I was able to get it to work. Success, it should just work now, right?!

Nope, well, most of the time. Every so often I would get TCP timeouts. So I looked into it some more and finally found the real solution to solving my problem. I had to remove and re-add the Virtual Box networking interface for the virtual machine (VM) my docker-machine was using:
sudo route -nv delete -net 192.168.99 -interface vboxnet2
sudo route -nv add -net 192.168.99 -interface vboxnet2

When Solomon (@solomonstre) told me they were working on something that would make it so I no longer needed Virtual Box in order to run Docker on my Mac and asked if I wanted to test it out, I was pretty ecstatic. This did come with a warning though that what I would be testing was very much in its Alpha stage. I had to sign a NDA and then was sent and documentation. I closed Virtual Box, removed all of my Docker Machine environment variables, and Docker still ran!

Running the app for the first time in the Docker office

However, as expected, not everything worked smoothly in the beginning, particularly on a corporate network/VPN. In short, Docker would not work on VPN. It just had not been tested yet. This made me the perfect test user because I was constantly moving between home and work/VPN. While it took a few back-and-forth emails with Michael Chiang (@mchiang0610) and others on the the team, eventually it worked consistently, which was a net improvement over using Virtual Box. Now there is this handy, experimental feature to enable VPN compatibility mode so I can easily run it at work and at home :).

As you can see, I don’t have Virtual Box running, but Docker is (and this is on VPN!):

It runs on top of Alpine Linux on a xhyve virtual machine:

Along with the Beta are detailed docs to help you get started both with using the app and Docker itself as well as how to debug issues you may run into:

There are also many other useful features for debugging the app such as being able to quickly jump to your logs:

To see others you will have to try out the Beta yourself ;).

For more about it, read Patrick Chanezon’s (@chanezon) blog post, watch the webinar on March 30th, and sign up for the Beta!