Docker Vs Virtual Machine

Digitization places quite different demands on today’s IT infrastructures than it did just a few years ago: Digitized processes must be faster, leaner and more agile. In this requirement scenario, the lightweight containers hit like a comet. Are virtual machines now getting retired and will disappear from this race? The answer is still tough and let's have a quick overview of these both technologies.

A few years back, docker was of no existence and with the limitation of virtualization technology, docker came into the limelight with open source content management platform. The IT departments of companies today deal intensively with the application possibilities of containers in the business context. Is it hard for classic virtualization using hypervisor and virtual machines (VM)?

The term post-virtualization has been introduced. However, this couldn’t bring the large player like Microsoft and VMWare back to the track. The struggle is real.

Docker runs is the same operating system as its host. This allows it to share a lot of the host OS resources with layered file-system (AuFS) and manages networking. AuFS (advanced multi-layered unification file-system) started as an implementation of Union File System. It overlays it on a newer file-system and allows files and directories of separate file-system to co-exist under a single roof. On Debian based systems, for example on Ubuntu do the following to install AuFS .

# apt-get install aufs-tools

So, let's explore these terms. Let’s say you have a 1 GB of OS image and with each addition of different VMs, you will require more storage/memory. That means the resource utilization is done properly as each VM requires a complete duplicate system again. With dockers and AUFs you can share this bulk of 1 GB between all containers and might need only a little bit of space for the 100’s of the container. With docker containers are light and you could easily run thousands of container on a single host. With the exception of full isolation and guaranteed resources, docker is already a good choice.

Docker vs VM

source: https://jaxenter.de/wp-content/uploads/2017/03/wurbs_container_1.jpg

Using Docker all applications have their own dependencies. Docker is an open platform for developers and it’s scalable and safer to use and deploy as compared to previous approaches.

Virtual machines have a full OS with its own memory management installed with the associated overhead of virtual device drivers. In a virtual machine, valuable resources are emulated for the guest OS and hypervisor, which makes it possible to run many instances of one or more operating systems in parallel on a single machine (or host). Every guest OS runs as an individual entity from the host system.

On the other hand, Docker containers are executed with the Docker engine rather than the hypervisor. Containers are therefore smaller than Virtual Machines and enable faster startup with better performance, less isolation and greater compatibility possible due to sharing of the host’s kernel.

Docker Container VS Virtual Machines:

When it is a matter of performance, it could be said that Docker has more potential than Virtual Machine. Docker containers are able to share a single kernel and share application libraries. Containers present a lower system overhead than Virtual Machines and performances of the application inside a container is generally better as compared to the same application running within a Virtual Machine.

Traditional Virtual machines could take up several minutes to create and launch whereas a container can be created and launched just in a fraction of minutes or even seconds. A single server can pack more than one containers as OS is not duplicated for each application.

Hybrid Approaches:

Let's try to combine Virtual machine with docker concept. It might lead to a better and efficient scenario. Docker containers can run inside Virtual Machines though they are positioned as two separate technologies and provide them with pros like proven isolation, security properties, and networking and many more.

Conclusion:

Working in a heterogeneous environment, Virtual Machines provide high flexibility whereas Docker containers’ prime focus is on applications and their dependencies. If the application is designed to provide scalability and high availability then containers can be handy.

mm

Anup Chhetri

IT system administrator

You may also like...

error: Content is protected !!