Is Docker the Same as a Virtual Machine?
Last updated: Jul 19, 2022
When I first heard of Docker six years ago, people talked about it in a way that made it sound similar to virtual machines. It certainly seems like a VM in some ways - you can choose different Linux distros for your containers, you can turn them “on” or “off”, and they allow you to run applications somewhat separately from the host they run on. Doesn’t that sound like a VM?
While it might sound similar, Docker and other containerization technologies don’t use real, CPU-level virtualization that you would see with ESXi, Hyper-V, KVM, and other hypervisors. Containers actually share the kernel and other resources of the host operating system, instead of being fully separate operating systems like VMs. Containers offer the ability to encapsulate libraries, binaries and other resources without the overhead of a hypervisor. This makes containers lighter-weight and easier to manage compared to virtual machines.
For further reading, I highly recmomend BackBlaze’s article “What’s the Diff: VMs vs. Containers”.