Docker does not fully virtualize an OS the way a virtual machine (VM) does.
Docker uses containers, which:
- Share the host’s kernel (Linux kernel in most cases).
- Package your app + its dependencies + filesystem, but not a separate kernel.
- Use kernel features like namespaces and cgroups to isolate processes.
So a Docker container is more like:
“A process on your machine that thinks it’s alone and has its own filesystem/network/etc.”
Whereas a VM is:
“A whole other computer running inside your computer, with its own virtual hardware and its own kernel.”
Short answer: you need a compatible host, but there are layers that can help.
Because containers share the host kernel:
- You cannot run a true Windows kernel inside a Linux container, or a true Linux kernel inside a pure Windows container.
- You can have:
- Linux host → Linux containers
- Windows host → Windows containers (using the Windows kernel)
- Windows/macOS → Linux containers via the hidden Linux VM that Docker Desktop runs.
So:
Docker doesn’t virtualize the OS kernel. You either need a host with the right kernel, or (on Windows/macOS) Docker will spin up a small VM that provides that kernel for you.
If you tell me what OS you’re on (Linux, Windows, or macOS), I can describe exactly what’s happening in your setup.