How is Docker different from a Virtual Machine?


Docker containers are isolated processes within their namespaces. Virtual Machines are full-blown Operating Systems (OS) living on Hypervisors. In this article, we are going to look at differences between them.


VMs increasing density and efficiency in our data centers.

Here, we are using the same hardware (HW) but hosting many guest Virtual Machines (VMs) with the same or different OSs. Virtualization technology is virtually slicing and assigning HW compute resources (Cpu, Memory, Network, Storage) to each guest VMs with the help of Hypervisor. This resource share is happening based on the VMs configuration.

Each VM is independent from other VMs and getting their minimum resource assignments. So you can install a Windows OS on the one guest VM. At the same time, you can install a Centos Linux OS on another guest VM. Normally those OSs will continue to run on the same HW without interfering with each other. Virtualization technology is creating an illusion for the guest VMs. As a result, they are thinking that they are the only ones on the HW host.

If you look at VMs from the operation side, you have to do deal with a couple of administrative tasks. These tasks are providing business continuity. Like OS installation, VM backup, restore, OS patching, OS update, Application Installation, providing high availability,.. etc. Even if you take the smallest OS package distros for your VMs those administrative tasks will take long minutes and lots of spaces.


On the other hand, Container technology is giving us more isolation and segregation between applications. A container is more granular than the normal VMs in terms of resource and management wise. Because it is only an isolated process living on your favorite OS. A container is containing an application and it is dependencies (library,configuration). But VM is a full-blown Operating System (OS). It is containing all users, groups, filesystem, process, network, HW drivers, management tools and packages. Therefore the management of containers takes seconds or short minutes.

Containers are increasing delivery speed while standardizing application deployments.

Containers are interacting with the same Host kernel. Actually, they are all isolated processes and container engine is creating an illusion for them. Like we have same example in the Virtualization part, Containers are thinking that they are the only ones on the OS there are no other processes living. They don’t know, they don’t care also.

We see the above application deployment evolution in the data centers. Because many container orchestrators solutions can be installed directly on Bare Metal servers. This is eliminating the need for hypervisors. OS management and all other low-level infrastructure management tasks are burning IT budgets.

Containers and Container orchestrators are helping us to decouple infrastructure from the application. Instead of focusing the infrastructure side now with the help of containerization we can focus on the application itself. Like if I have written a Java Hello World application I can run that application on any JVM and can print Hello World! Likewise, If I have a container image hello-world then I can run that image as a container on any container engine! this is the motto of Docker also, build once, run anywhere!

Let us know the difference is clear for you now with this article. don’t forget to subscribe to our email list to get the latest news!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.