Before talking about Docker, it would be better to discuss the technology behind the software container.
Virtual machines are a common virtualization technology and have been widely adopted by cloud providers and enterprise companies. Actually, a software container (or container for short) is also a kind of virtualization technology, but there is something different about them. The key difference is that every container shares the same kernel on the host machine, while each virtual machine has its own kernel. Basically, a container uses virtualization techniques at the level of the operating system, not the hypervisor. The following diagram shows a comparison between container and VM stacks:
Figure 2.1: Containers versus virtual machines
Linux's container technology heavily relies on two important kernel capabilities, namespace and cgroups. Namespace puts a process into isolation so it has its own of set of global resources, such as PIDs and networks. Cgroups or control...