Docker Native Mac App: A Review from a Drupal Perspective

Ian Lintner
Pour Over
Published in
3 min readJun 30, 2016
Docker running in the menu bar.

I have been testing out the beta Docker native Mac version for hosting my local dev sites. The new Docker app is not truly native as it uses xhyve to run the Docker server on a light weight Alpine Linux distro. For more details you can read the official Docker blog post.

Docker Preferences Window

The native Docker app does come with some nice benefits. The big one for me is gaining access to the local file system for mounting. The second major perk is everything is available on localhost network instead of the virtual box IP.

Note: The proceeding information is not up to date. Docker implemented file system volume cache hints. https://docs.docker.com/docker-for-mac/osxfs-caching/#examples It helps with performance, but out of the box the info below is still accurate. You will need to implement volume caching for larger drupal projects or you will hate it.

On the downside there is a noticeable performance hit on file access, which Drupal makes a large amount of file calls. This scales with the number of modules you use. Trying to access the features page is painful at best. The Docker native app is using the new osxfs compared to shares over NFS to virtual box.

For more information on the performance issues related to osxfs this discussion provides a quantitative analysis of osxfs vs NFS rather than my qualitative ‘it feels slower’ test.

https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/44

Advanced e.g. XHYVE Performance Settings

A quick summary of what you get with the “native” Docker App on Mac versus the default Docker machine:

  • Simple setup, install and run.
  • Closer to native setup and experience.
  • Local Volume Mounting rather than being limited to your user directory out of the box.
  • No messing with NFS.
  • Your sites can be accessed via localhost 127.0.0.1
  • Included DNS server.

That being said right now for Drupal dev for performance reasons I will probably continue to use a docker machine via the dinghy service. Dinghy provides some of the same functionality as well as a built in proxy server and the faster NFS file mounts.

The other thing I noticed is the beta versions of docker and docker-machine that came packaged with the native app are even more performant than the past versions with Dinghy configuration.

There are a couple of pitfalls when setting it up.

See the docs for more info:
https://docs.docker.com/docker-for-mac/#/what-to-know-before-you-install

If you have have Docker Machine already setup you can run them side by side but you to do a couple of things:

  • Unset the docker machine ENV variables for HOST, TLS, etc
  • If you don’t want to use two versions of the client you have to upgrade your Docker machine box.

The other major issue I ran into is that the Docker server will not use fallback DNS servers in your Mac network settings. So if you are using a corporate DNS you must be able to connect to it or move another DNS server up such as Googles public DNS e.g. 8.8.8.8.

I think this maybe a while till the native app catches up. Once the performance and some of the rough edges are polished I will have no question about switching.

Additional Notes/Information:

Here is a great review: https://medium.com/@nzoschke/docker-for-mac-beta-review-b91692289eb5#.e9xb8im3h

A good discussion on Hacker News about the above review: https://news.ycombinator.com/item?id=11352389 it is a little out dated, but has good information.

Another alternative to Docker native and the standard Docker Machine setup is the dlite project. https://github.com/nlf/dlite

Discussion of OSXFS on xhyve vs NFS on VirtualBox or VMWare: https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/44

--

--

Ian Lintner
Pour Over

Full Stack Software Engineer, Local Food Producer, Digital Philosopher. https://www.linkedin.com/in/ianlintner