Can Mac OS X be run inside Docker? If so, any suggestion as to how?

And would it be running headless, or there would be a possibility to connect to the GUI remotely?




Docker provides methods for managing OS-level containers and is built on top of Linux's native features for OS-level containerization. All containers running on a system share the same kernel; Mac OS X does not use the Linux kernel, but rather a mach kernel, so it cannot be run inside a Docker container at this time.

You can run Docker on your Mac using a virtual machine, but containers running on that instance would need to run Linux.

Now that Docker uses libcontainer rather than LXC as its basis, it is possible that porting of libcontainer in the future could one day allow for running Windows and Mac OS Docker containers on those systems respectively, but it would depend on appropriate OS features being available to allow for containerization.

  • 16
    so [Mac] cannot be run inside a Docker container at this time. <-- Are there any updates on this now? Or are we still restricted to pure Linux applications? – Hippo Aug 9 '16 at 4:24
  • 6
    Nowadays (Jan 2017) docker runs on windows platform and is able to run either windows or linux kernel-based images, but not both at the same time – MaxXx1313 Feb 2 '17 at 15:57
  • 4
    The question is about runnning MacOS inside a virtual environment. The questions was not whether a MacOS can run Docker. – Ken Ingram Dec 29 '18 at 17:09

Running an OSX VM in a Docker container is possible. Take a look at https://github.com/Cleafy/sxkdvm for example.

  • 14
    Running a VM inside a Container seems to be kind of missing the point of containers... – Shayne Jan 9 at 6:35
  • Agreed. This is an impressive achievement, but there's near zero advantage to doing so. – Wilfred Smith May 7 at 18:51
  • Well what if you want to build an electron app for osx? – Krimson Jul 17 at 0:09
  • 1
    If you want to orchestrate an OSX machine using the many available tools for docker, this makes sense. For example for CI purposes. – thoutbeckers Aug 1 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.