Docker isn’t truly native outside Linux, and here’s why.
If you’re using Docker on Windows or macOS, your containers aren’t running directly on those operating systems. They run inside a small Linux virtual machine, created by Docker Desktop using technologies like WSL2, Hyper-V, or a hypervisor.
Docker was originally built only for Linux because containerization, at its core, depends on Linux kernel features, specifically namespaces and cgroups.
Namespaces handle isolation, giving each container its own sandboxed view of system resources like processes, networks, mount points, and filesystems.
Cgroups (Control Groups) manage and restrict resource usage (CPU, memory, bandwidth, I/O) so containers don’t overload the host.
Other operating systems simply don’t implement these kernel mechanisms in the same way, which is why Docker can’t run Linux containers directly on Windows or macOS kernels. The workaround? Docker runs a lightweight Linux VM behind the scenes, and everything operates inside it — sharing its kernel, not the actual host OS kernel.
Yes, Windows containers exist and can run natively on the Windows kernel, but they are a separate container type. The moment you run a Linux container, a Linux kernel layer becomes mandatory, regardless of whether the host machine is running Windows or Mac.
Top comments (0)