In: Computer Science
What problems would be solved by moving from virtual machines to containers?
A virtual machine was first defined by Popek and Goldberg as “an efficient, isolated duplicate of a real machine.” Even earlier than that formal definition of VMs, a form of virtualization for mainframes was invented and used internally in the 1960s by engineers at IBM. VMs using a hypervisor, which creates and manages VMs on a physical machine became commercially available in 1972.
Virtual machines provide an abstraction of the physical machine that includes BIOS, network adapters, disk and CPU. Every virtual machine running on a physical server runs a separate instance of the operating system. In fact, virtual machines deployed to a server can run different versions of the operating system or even different operating systems. A hypervisor creates and runs the different virtual machines.
Containers are comparatively newer than virtual machines, with implementation becoming more common only in the past eight years. The idea originated in 1979 with UNIX chroot, which provided isolated disk space for each process in a UNIX operating system. In the early 2000s, early container technology FreeBSD Jails was introduced. Innovation was incremental over time until 2008 when the LXC Project released the first Linux container manager.
With containers, the operating system, not the physical hardware, is virtualized. Applications are run in containers as microservices that provide the entire runtime image, including libraries and any other dependencies.
Instead of using a separate hypervisor to provide virtualization, containers like Docker rely on the functionality of the underlying OS kernel to restrict an application to certain features and file systems. In containers, applications share the kernel but have separate user spaces.
When to use virtual machines over containers
Because VMs and containers meet different needs, there’s a place for both within a company. In fact, they shouldn’t be evaluated as alternatives to each other. Instead, enterprises need to recognize that they address the issues of different user bases who have different concerns.
Use VMs to address issues at the hardware level and in the data center, and are appropriate when you need to:
Containers help application teams or DevOps teams package software and improve the release process. Containers make it possible to: