MachineRoom

Machine Room · 14 Aug 2026 · 5:27

What a Docker Container Actually Is (Not a VM)

Watch on YouTube

Almost everyone learns Docker with the same mental picture: a container is a tiny, lightweight virtual machine. It isn't. There's no machine in there — there's no box at all.

What Docker calls a container is an ordinary process, the same kind of thing as your text editor, running on the kernel you already have. Two Linux features do all the work: namespaces decide what that process can see, and cgroups decide what it can spend. The image is just a stack of read-only layers underneath it.

Chapters

  1. 0:00The Box That Isn't
  2. 0:40The Machine You Imagined
  3. 1:29What It Can See
  4. 2:31What It Can Spend
  5. 3:25The Stack of Sheets
  6. 4:18The Confession

Sources

Every claim traces to a primary source: the Linux man pages (namespaces(7), pid_namespaces(7), mount_namespaces(7), cgroups(7)) and the official Docker documentation.

Get the next one by email

One email per video, with the sources. No newsletter padding, no selling the list. Leave any time.

Transcript

The narration, word for word, from the subtitle file that ships with the video.

0:00The Box That Isn't

Right now, somewhere on your machine, a container might be running — and I can tell you exactly what's inside the box: nothing. There is no box. What Docker calls a container is an ordinary process — the same kind of thing as your text editor — running on your own kernel, with the files it needs bundled beside it. The little machine inside the machine you've been picturing does not exist. What exists is a story your kernel tells that process — a lie about what it can see, and a lie about what it can spend. This video is how that lie is built. And at the end, a confession: your laptop has been telling you an even bigger one.

0:40The Machine You Imagined

Start with the thing a container is not. A virtual machine is exactly what its name says: an entire computer built out of software. A hypervisor fakes the hardware — the disks, the network cards, the memory. On top of that fake hardware, you install a complete operating system, with its own kernel, its own drivers, its own boot sequence. It is heavy, and that's the point — a wall of virtual hardware stands between the guest and the world. If containers worked that way, running ten of them would mean booting ten operating systems, and your laptop would be on fire. So Docker does something entirely different. It builds no wall at all. It changes what one process is allowed to see.

1:29What It Can See

The Linux kernel keeps global lists: every process on the machine, every network device, every mount point. A namespace wraps one of those resources in an illusion — the kernel hands a process its own private copy of reality. Drop a process into a fresh PID namespace, and it looks at the process table and sees itself: process number one, alone on the machine. Give it a network namespace, and it gets its own private network stack. Give it a mount namespace, and it gets its own view of the filesystem — your real disk simply isn't there. Linux has eight of these, and Docker starts your process inside a fresh set of them. The kernel's own manual says it plainly: one use of namespaces is to implement containers. A container is not a thing the kernel has. It's a thing namespaces do.

2:31What It Can Spend

Namespaces control what a process can see. The second mechanism controls what it can spend. Control groups — cgroups for short — let the kernel gather processes into groups and meter each group: this much memory, this much processor time. That is what the memory flag on a Docker command really is. It isn't a suggestion — it's a cgroup limit, and when your process crosses that line, the kernel kills your process to free the memory. Notice what is missing: no hypervisor, no virtual hardware. The same kernel that schedules your browser is simply enforcing a budget. Seeing, and spending — that is the entire trick. A container is a process wearing blinders, living on an allowance.

3:25The Stack of Sheets

One piece left: the files. A Docker image is not a disk — it's a stack of transparent sheets. Each instruction in a Dockerfile lays down one sheet: the base system, then your dependencies, then your code. Every sheet is read-only, forever. When a container starts, Docker lays one blank sheet on top — the only one it can write on — and the process sees the whole stack, flattened, as its filesystem. That is why a container starts instantly: nothing boots, nothing installs, nothing is copied. And it's why twenty containers from one image cost barely more than one — they share every read-only sheet, and each brings only its own blank sheet on top.

4:18The Confession

So put it together. A container is an ordinary process — namespaces decide what it sees, cgroups decide what it spends, and underneath, a stack of shared read-only files. Docker invented none of it. The kernel could do all of this years before Docker existed. Docker arrived in twenty-thirteen — a conference demo short enough to fit in a coffee break — and packaged those features so well that we forgot what they were. Which brings us to the confession. Everything here needs a Linux kernel. Without one, there is nothing to tell the lie. Your Mac does not have one. So Docker Desktop quietly boots a real Linux virtual machine, and every container on your laptop runs inside it. The box we just proved doesn't exist? On a Mac, it's the only reason any of this works. There is no container — just a kernel, telling a process a story.

Visuals are code-rendered motion graphics — no stock footage, no AI imagery. Narration is synthetic. How it's made.