Menu

1 / 6

Docker Containers Aren't Virtual Machines: How Namespaces, cgroups, and OverlayFS Actually Work Under the Hood

DEV Community: docker·S M Tahosin·about 20 hours ago
#cu1SVP29
#devtodocker#devto#dev#container#docker
Reading 0:00
15s threshold

Ask almost any developer to explain what a Docker container is, and you will usually get a diagram contrasting two towers:

On the left sits a Virtual Machine: an Operating System, a Guest Kernel, a Hypervisor, and virtual hardware drivers weighing several gigabytes.

On the right sits a Container: a slender box labeled "App and Dependencies" sitting directly on top of the "Host OS and Docker Engine."

The conclusion is invariably recited like gospel:

"Virtual machines virtualize the hardware. Containers virtualize the operating system. Containers are just lightweight virtual machines."

It is a convenient mental model for slide decks. It is also completely wrong.

There is no such thing as a "container" inside the Linux kernel.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.