Hacker News new | past | comments | ask | show | jobs | submit login

Let me explain Docker for Mac in a little more detail [I work on this project at Docker].

Previously in order to run Linux containers on a Mac, you needed to install VirtualBox and have an embedded Linux virtual machine that would run the Docker containers from the Mac CLI. There would be a network endpoint on your Mac that pointed at the Linux VM, and the two worlds are quite separate.

Docker for Mac is a native MacOS X application that embeds a hypervisor (based on xhyve), a Linux distribution and filesystem and network sharing that is much more Mac native. You just drag-and-drop the Mac application to /Applications, run it, and the Docker CLI just works. The filesystem sharing maps OSX volumes seamlessly into the Linux container and remaps MacOS X UIDs into Linux ones (no more permissions problems), and the networking publishes ports to either `docker.local` or `localhost` depending on the configuration.

A lot of this only became possible in recent versions of OSX thanks to the Hypervisor.framework that has been bundled, and the hard work of mist64 who released xhyve (in turn based on bhyve in FreeBSD) that uses it. Most of the processes do not need root access and run as the user. We've also used some unikernel libaries from MirageOS to provide the filesystem and networking "semantic translation" layers between OSX and Linux. Inside the application is also the latest greatest Docker engine, and autoupdates to make it easy to keep uptodate.

Although the app only runs Linux containers at present, the Docker engine is gaining support for non-Linux containers, so expect to see updates in this space. This first beta release aims to make the use of Linux containers as happy as possible on Windows and MacOS X, so please reports any bugs or feedback to us so we can sort that out first though :)

xhyve isn't exactly production ready (and the main repo hasn't been updated for a while). Did you guys actually solve some of the major problems (e.g., https://github.com/mist64/xhyve/issues/86 - crash coming back from sleep) or is that an expected part of the beta experience?

Yes, quite a few issues of that nature have been fixed (and we are planning to open-source the changes later in the year once we stabilise the overall application).

The bug above has been reported to Apple and they've reportedly fixed it in the latest 10.11.4 seeds, but we've put in a workaround that detects ACPI sleep events and freezes vCPUs just before going into hibernate mode. None of the beta testers have reported any sleep crashes using Docker for Mac recently, so if you do see anything of this nature please let us know.

I have not experienced this crash, and even had a container running last night, put the laptop to bed, woke it up this morning and the container is still there, running and interactive. Running OSX 10.11.3

> the networking publishes ports to either `docker.local` or `localhost` depending on the configuration.

Perfect. We had to ditch Kitematic on OS X due to the lack of port forwarding, since we couldn't get OAuth redirects to work when developing locally.

"Most of the processes do not need root access" - To create the VM network interfaces the vmnet_start_interface() in pci_virtio_net_vmnet.c function needs elevated privileges... how have you managed to get around not having to run xhyve as root just to have a virtual Nic?

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact