I always wonder how Docker works on macOS with a more UNIX-style kernel than Linux
It doesn’t. Macos also uses a virtual machine for docker.
but is it really that hard to do Docker/OCI out of Linux?
Yes. The runtimes containers use are dependent on cgroups, seccomp, namespaces, and a few other linux kernel specific features.
You could implement a wine like project to run the linux binaries that containers contain, and then run some sandboxing to make it be a proper container, but no virtual machines or virtual machine container runtimes* are easier.
Linuxulator, a freebsd project does the above.
https://people.freebsd.org/~dch/posts/2024-12-04-freebsd-containers/
*these are much lighter than a normal vm, I’ll need to check if this is what macos does. I know for a fact docker on windows uses a full Linux vm though.
[moonpie@osiris ~]$ du -h $(which filelight) 316K /usr/bin/filelight
K = kilobytes.
[moonpie@osiris ~]$ pacman -Ql filelight | awk '{print $2}' | xargs du | awk '{print $1}' | paste -sd+ | bc 45347740
45347740 bytes is 43.247 megabytes. That is to say, the entire install of filelight is only 43 megabytes.
KDE packages have many dependencies, which cause the packages themselves to be extremely tiny. By sharing a ton of code via libraries, they save a lot of space.