Skip to main content
To understand how Docker works, it helps to revisit a few core operating system concepts. Most Linux distributions — Ubuntu, Fedora, openSUSE, AlmaLinux, and others — are built from two main parts:
  • the kernel (Linux), which talks directly to the hardware and provides low-level services (system calls, drivers, process scheduling, memory management, etc.), and
  • the userland, which consists of shells, desktop environments, package managers, development tools, and libraries that differ between distributions.
Docker containers share the host kernel. Practically, this means you package an application’s userland dependencies (binaries, libraries, config) inside the container, but you do not ship a separate kernel. Containers rely on the host kernel for low-level services, so a Linux Docker host can run containers created from different Linux distributions (Ubuntu, Debian, Fedora, openSUSE, AlmaLinux, etc.) as long as those containers are compatible with the host kernel ABI.
A slide diagram explaining Docker containerization, showing Ubuntu, Fedora, openSUSE and AlmaLinux containers sharing a single Linux kernel. A presenter wearing a KodeKloud shirt appears on the right.
Each container includes only the userland components that differentiate distributions — not a full kernel. Under the hood, Docker uses Linux kernel features to create lightweight isolation:
  • Namespaces: isolate resources such as process IDs, users, mount points, and network stacks so each container behaves as if it has its own environment.
  • cgroups (control groups): limit and account for CPU, memory, device I/O, and other resource usage per container.
These kernel primitives enable process isolation and resource control without the overhead of a full virtual machine. How does this work on non-Linux hosts (for example, Windows)? Because containers share the host kernel, you cannot run a Windows-kernel container on a Linux host and vice versa. To run Windows containers you need a Windows host that offers the Windows kernel. Conversely, to run Linux containers on Windows, Docker Desktop provides a lightweight Linux kernel (via WSL2 or a small Hyper-V VM) and runs the Linux container inside that VM. The stack looks like this: Linux container → Linux VM → Windows host A common example you might run on Windows with Docker Desktop:
This command appears to run a Linux container directly on Windows, but Docker Desktop actually provides the Linux kernel (via WSL2 or Hyper-V) so the container has the kernel it needs.
A slide titled "Sharing The Kernel" showing a nested diagram (Windows Host containing a Linux VM which contains a Linux Container) with a presenter gesturing on the right. The caption below explains "Linux Container → inside Linux VM → inside Windows Host."
Is sharing the kernel a disadvantage? Not really. Unlike hypervisors — which virtualize hardware to run multiple full operating systems and kernels — Docker focuses on packaging and isolating applications with their userland dependencies. That design makes containers:
  • Lightweight: containers start fast and have low overhead.
  • Portable: an app packaged in a container runs anywhere with a compatible kernel.
  • Efficient: many containers can share kernel resources on one host.
Compatibility and use cases at a glance: For most application packaging and deployment workflows, containers provide the advantages of reproducibility and speed because they isolate userland dependencies while sharing the host kernel.
Containers share the host kernel and isolate userland via namespaces and cgroups. On Windows or macOS, Docker Desktop supplies a Linux kernel through WSL2, Hyper-V, or a lightweight VM so Linux containers can run on non-Linux hosts.
Further reading and references:

Watch Video