Container technology is making rapid strides with some recent reports putting the adoption rate as high as 5x times in one year. But surprisingly not many are aware of Container technology and how exactly it is different from virtual machines.
In the last decade, due to the rapid advancement in server technology the bare metal applications i.e. applications programmed to work on specific hardware in a system was unable to fully utilize the processing power and capacity of servers, leaving resources underutilized necessitating the birth of virtual machines.
Virtual machines are designed by the emulation of particular hardware system by running software on top of a physical server. Many VMs with different operating systems may be run on the same physical server with a unique OS inside each VM. So a Linux VM may easily co-exist with a Unix VM. The benefits of this technology was, it ushered in a system of consolidation of applications on to a single system instead of the prevalent single application/system accruing massive cost benefits and helping in optimal utilization of processing power and capacity of physical systems.
Container is a complete package consisting of entire runtime environment: an application, plus all its dependencies, its libraries, binaries and configuration files. This way the differences in OS distribution and the underlying infrastructure may be overcome to make the application portable on to any platform or OS.
In short, three VMs with three separate OSes running on top of it may sit on a single physical system with a hypervisor, whereas three containerized application runs on a single OS in a single server.
The size of a VM and a Container varies widely, sometime a Container may be in megabytes, the VMs because of its operation systems will usually be in gigabytes. So obviously a single server can host more containers than it can host VMs. And for this same reason a container can boot almost instantly whereas a VM may take several minutes.
But as several containers share the same OS on the kernel level, it cannot provide the same degree of isolation as a VM does and so is lot more vulnerable to security threats.