It turns out Windows developers using Docker have the same complaints that Mac users of Docker do. In fact, I know people who run Docker Desktop inside a VirtualBox Linux VM on their Macs because it's so much faster than the VM Docker spins up.
The dev environments feature in preview for Docker Desktop[0] is supposed to make this flow easier, but if you have to do anything that doesn’t fit into the “I’m writing a web service that is easy to proxy” mindset, you’re better off doing a full VM with Linux (via Multipass or VirtualBox or whatever) and keeping your code in there if you want maximum performance.
You're much better off using your own VM and the free software docker CLI tool. Set DOCKER_HOST to "ssh://root@$VM_IP".
Unsubstantiated claims like this often get a rise out of me, and I was tempted to reply with a sarcastic “go on…”, but I’ll try to have a more charitable discussion.
APFS performs very well. So does ext4 or zfs or whatever. So it seems your claim is not only that the file system bridge is the source of performance degradation (which it is, I agree), but that’s somehow by design for [reasons]? This is my sincere, charitable attempt to understand your scare-quote laden use of the word feature.
Is that what you mean? If so, can you explain why? If not, I’m happy to understand what you actually mean.
It goes from 10-20s to 6 minutes. It takes 2-3 minutes to install node_modules alone due to the massive number of files. Trying to mount them with buildkit, provide a prepackaged cache folder, etc, are all pointless since they suffer from the same I/O slowdown. Building a go executable also goes from < 10s to > 60s.
It's no thanks to Apple, but there actually is a very good ZFS driver for macOS. I've been using it for several years. https://openzfsonosx.org/
(You can't use ZFS as your root filesystem though, which may be what you meant.)
Granted I’m still on Catalina, but I have never heard anything like this before. That seems like it would cause a huge uproar. But…
> Why is it harder and slower to run docker on macOS than anywhere else?
… I don’t think this has to do with the Unix layer, and I’d expect other Unixes to similarly struggle with Docker. Because Docker only runs natively on Linux. All other OSes need either a VM or (in Windows’ case) WSL.
To be honest I think this is one of the biggest problems with Docker and I’m not sure what Apple can do about it (switching to Linux underpinnings is entirely unrealistic).
Otherwise I largely agree, but I feel this deserves clarification.