Technical Basics
Docker is an open source container technology that became immensely popular in 2014. Docker itself is written in Google’s programming language Go and supported on all major Linux distributions (RedHat, CentOS, Oracle Linux, Ubuntu etc.). The technical underpinnings are not completely new, Docker leverages Linux kernel features for containers such as cgroups and namespaces. So even though Docker itself is relatively new, the underlying container technology is an established technology. Docker containers run on top of an operating system.
It is reported that Google starts 2 000 000 000 every week for search, mail, etc.
Virtualization versus Container
It’s important to distinguish Linux containers and Docker from traditional and more common type 1 or type 2 hypervisors. Type 1 hypervisors provide server virtualization with different operating systems on bare metal hardware, whereas Type 2 hypervisors often provide desktop virtualization based on an existing operating system as shown below.
In contrast to popular virtualization technologies, Docker containers run the host’s Linux kernel. Docker is about isolation, not about virtualization. The required time to startup a container is only in the range of milliseconds. Still containers have their own incremental files system, where layers are reused across containers. In addition, every container has its own network stack, therefore its own IP-address, and its own process space.
I am still unclear about the difference between Docker and Type 1 Hypervisor. Is the only added advantage of Docker is that it hosts Linux kernel ?
Hi Ankur,
The advantage is that a Docker image does not contain an operating system!
It does not boot Windows, or Linux, it is running on the existing kernel of the host.
So it starts up in milliseconds as oposed VirtualBox in maybe 45 seconds. I can run hundreds of containers on my Laptop. How many VirtualBox instances can you run at the same time?
See here for the possibilities:
https://www.youtube.com/watch?v=jS6woAiualk
enjoy!
> type 1 hypervisors provide server virtualization
> type 2 hypervisors provide desktop virtualization
is incorrect. The classification of “server” vs “desktop” is independent of virtualization.
Containers, originally appeared as “jailed applications” (or chroot-ed) environment. But now they have more features like segregated I/O, Filesystem, etc.
Containers run on top of a full blown operating system (on top of hardware), so you have a 3 layer stack. So if you are in a SaaS business, you can not have a linux runing along side a window. With hypervisor type 1, you can have N guest os each running whatever OS they want.