# Docker Basics Instead of virtualizing hardware like a virtual machine, Docker virtualizes the operating system, allowing you to run multiple OSes on shared hardware resources. ^qfz2cn Here's a nice diagram explaining the difference. On the left is the traditional VM model where hardware is split between different virtual machines using a hypervisor. On the right is the Docker model, where a Docker Engine is running on the host. It replaces the hypervisor and runs individual Docker containers. All containers share the same hardware resources but are isolated. ![[Docker vs VM diagram.png|400]] The main benefit of a Docker container is the ability to move it to a different machine. You can package all of your dependencies and then deploy them easily anywhere. **The main performance advantage of starting a Docker container as opposed to a VM is that all Docker containers share a single OS kernel, whereas each VM has its own. The performance boost comes from not having to boot a kernel for every container.** This illustrates the drawback of Docker: you cannot run Linux containers on Windows and vice versa (well not really because of WSL, but that's a different story). ## Sources - Intro videos by NetworkChuck: - [Docker Containers 101](https://www.youtube.com/watch?v=eGz9DS-aIeY)