by munro · 5y ago · 0 comments
Edit: Docker on Mac has never felt as snappy as on Linux, because of the VM, though I have no hard numbers. Networking is a PITA, but it's not hard to figure out. The other main thing I hate is I have to give up a bunch of RAM to the VM that my containers may or may not use, instead of sharing with the host like on Linux.
It's extremely slow compared to Linux and I'm pointing my fingers at the virtualization layer without any hard evidence because it's the most likely suspect.
With all this focus on sandboxing apps of late, I'm wondering how far the OSX kernel is from having a feature set that resembles cgroups and network namespaces.
Glad to see they are making progress on the M1 port though, my team will be excited.
How is it so many people use docker but have zero fucking clue about how it works?
It's completely unsurprising that many folks haven't spent the time to dive into the internals. In many cases, because they don't need to.
Such is the nature of abstraction and higher level frameworks.
This is not true, for multiple reasons. Strictly speaking it only means you'd be able to run another instance of Darwin in a container. And, as you surely know because your tone of voice implies you bear immense knowledge, a Docker-style container is not a full OS: it doesn't run an init or normal system daemons, so it wouldn't even be a full instance of Darwin, so it wouldn't have to support functionality only needed by launchd or system daemons (e.g. WindowServer). It would just need to let you run a stanalone program in a chroot + separate network, PID, and IPC namespace + apply resource controls.
Furthermore, since most people are using Docker for developing software that's going to run on Linux, there would be no real need to virtualize the parts of XNU that aren't also provided on Linux - notably all the Mach stuff. You'd just need to provide a BSD-style syscall API to programs in a container.
Furthermore, not being able to hook into xnu to virtualize macos is a business decision, not a technical limitation.
That it is all so smoothly powered by Linux is what makes it a great product.
If apple gave a shit about non apple developers they would provide the kernel hooks to help make it possible.
Also, nobody deploys on mac hosts because virtualizing macos in a cloud environment is against tos, so options are expensive and limited.
Do people really not know how shit works these days?
Haven't tested it on M1 yet, but I doubt the networking challenges will disappear.
That said, as another person commented, you can run Windows for ARM in a VM on an Apple M1.
Docker Windows containers aren't available on arm64 Windows yet, but stay tuned...
I'm actually using a version of this setup today in order to run Docker on OS X 10.9.