What is the difference between a container and a virtual machine?
A VM virtualizes hardware and runs a full guest OS, so it is heavier and slower to start. A container shares the host kernel and isolates only the process, filesystem and network namespaces, so it is lightweight, starts in milliseconds and packs densely. Containers trade the stronger isolation of a VM for speed and efficiency.