Engineer Atlas
OverviewLearnJourneysOS LabFinderRoadmapPracticeInterviewCheat SheetCompareConnections
OverviewLearnJourneysOS LabFinderRoadmapPracticeInterviewCheat SheetCompareConnections
Operating Systems
  • How Programs Run
  • Processes
  • Threads, Async & Event Loops
  • CPU Scheduling
  • System Calls & Kernel Mode
  • Stack & Heap
  • Virtual Memory & Paging
  • Files, File Systems & Descriptors
  • I/O
  • Concurrency, Synchronization & Deadlocks
  • Inter-Process Communication
  • Sockets
  • Containers & the OS
  • OS Internals Lab
  • OS Debugging & Capstone
OS + Networking
  • OS + Networking Together
OS/Learn/Containers & the OS
Operating Systems

Containers & the OS

Containers are not small virtual machines: namespaces, control groups, layered filesystems, shared host kernel, and how that differs from a hypervisor.

The question this module answers · If a container has no kernel of its own, what is actually isolating it?
Containers Are Processes With the Kernel’s View Narrowed
▶ interactive

A container is an ordinary process (or tree of processes) whose view of the system has been narrowed by namespaces, whose resource use is capped by control groups, and whose root filesystem is a stack of layers — there is no guest kernel, which is both why containers are cheap and why their isolation is weaker than a VM’s.

Process Isolation: One Kernel, Many PID 1s
▶ interactive

Two containers on a host each have a process that believes it is PID 1 and a process tree that stops at it; the host kernel sees all of them as ordinary processes with ordinary PIDs, which is exactly why a kernel bug is a bug in every container at once.

VM vs Container: Where the Boundary Is
▶ interactive

A VM puts a whole guest kernel and virtual hardware between the workload and the host; a container puts only a narrowed view of one shared kernel — the difference decides isolation strength, startup time, density and which kernel you get, and microVMs exist because neither answer was right for running other people’s code.

Engineer Atlas
GitHub·LinkedIn