Why I won’t use docker on my MacOSX

(Appendix: since 2015, Docker accept xhyve to support native execution, this article is obsolete anymore)

[Vagrant](www.vagrantup.com/‎), is well-known tool for using virtualization software more easily. Docker is another tool, which is spreading recently, replacing vagrant position slowly. Since vagrant works well on OSX, why not Docker? And, yes, we can run Docker on MacOSX these days easily. Good news?

But, if you have no doubt to use Docker on Mac, please read this article. Because, I won’t use docker on my OSX. The beauty of Docker (actually, not only Docker, but every beautiful tools) is that they made heavy and complicated work mastication for every engineers, who want to use it, or read handy tutorials, and because of this easiness, it may mislead to use it regardless of its cost.

LXC, one of the base technology under Docker, stands for “Linux Containers”. As well as we call “Linux kernel-based virtual machine” as Linux KVM, it’s called LXC. So, generally, LXC is categorized “Container”, and KVM is “Virtual Machine Monitor”.

VMM and Containers are totally different technologies. VMM aims to run different computer on one computer. Therefore, they emulate what computer has, such as CPU, RAM, etc. Then, you can install and run any OS you want. And VMM is what vagrant used beneath.

On the other hand, Containers is developed from security perspective, it aims to develop separated environment in one computer. (This is why it’s called as Jail, chroot (change root))

VMM is well researched and deeply developed mainly by Xen, or VMWare, giants in virtualization. At the beginning, because it requires heavy cost for CPU, memory, I/O, they’re not daily used, but for special reason, such as ‘Want to run Windows on my Mac’ for personal users, ‘Consolidate servers into cloud-like servers’ for company users.

As time goes by, the more VMM has been used for server consolidations, they noticed that some of VMM run Linux, x64 virtual machines on Linux, x64 host machines. Which means, there’re no need for emulating.

Then, containers have become their option. Precisely, it is not virtualization, but they introduced LXC, or OpenVZ (another container technology) as “light-weight virtualization”. Containers is an isolation of environment, resources. So it doesn’t require any emulation costs. For people who run Linux on Linux, it seems rational choice.

So, now you know what I’m trying to say. LXC only works on Linux kernel, and not on OSX. Containers cannot change their kernel. Running Docker on OSX requires additional VMM cost to run Linux on it. (boot2docker prepares minimal image of Linux kernel for running it faster, but emulation cost is still there)

(Of course, it’s an option to run Docker on OSX for testing your Docker file correctness for example.)

 
79
Kudos
 
79
Kudos

Now read this

Three things I like about Golang

Now, Go is my second favorite language, and I want to write down why. Firstly, I was playing with Go around 2010, and attracted it because of gofmt, which was a big surprise for me. I was always saying, “Go is nice, because they have... Continue →