Card 02/ 05

ComparisonDifficulty: Beginner1 min

A Container Beside a Virtual Machine

Both hand you something that behaves like its own machine. They buy it differently, and the difference is what decides which one you want.

The same job, paid for two ways
Compared onContainerVirtual machine
What startsA processA kernel, then an init system, then your process
How longMillisecondsTens of seconds
What separates itKernel features, on a shared kernelA boundary drawn in hardware
Can run another OSNo, the kernel is the host'sYes

Reach for a container when you want the Linux you already have, packaged so it runs the same on someone else's machine. Reach for a virtual machine when you need a different kernel, or a boundary strong enough to put someone you do not trust behind.