Operating systems are made up of two layers - the Applications layer and OS Kernel layer. * The kernel is responsible for communicating with hardware components like CPU and memory. * Applications run on the kernel layer. Therefore, applications must be compatible with the kernel. ![[docker-vs-vm.png]] Docker and virtual machines are both virtualization tools that differ in the parts/layers of the OS they virtualize. * Docker only virtualizes the Applications layer and uses the kernel of the host machine. As a result, docker images are much smaller and containers can start and run much faster. * Docker images must be compatible with the OS kernel of the host. For example, a linux based docker image cannot be used on a host with a windows kernel. * Virtual Machine virtualize both, the Applications and the OS kernel layers. It virtualizes the complete OS, making virtual machine images much bigger and slower * Virtual machines of any OS can run on any OS host since they virtualize all layers of the OS. ![[docker-image-incompatible-kernel.png]]