Docker Containers Versus Virtual Machine-Based Virtualization: Proceedings of IEMIS 2018, Volume 3
Docker Containers Versus Virtual Machine-Based Virtualization: Proceedings of IEMIS 2018, Volume 3
net/publication/327389502
CITATIONS READS
0 396
3 authors, including:
Ritika Mehra
DIT University
23 PUBLICATIONS 15 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
A STUDY ON EARLY PREVENTION AND DETECTION OF BREAST CANCER USING THREE-MACHINE LEARNING TECHNIQUES View project
All content following this page was uploaded by Ritika Mehra on 29 January 2019.
1 Introduction
Cloud computing provides many benefits to end-users on the basis of basic char-
acteristics it poses. The characteristics include elasticity, availability, on-demand
self-service, and scalability. Due to these, various users from different domains like
industry, business, and other application hosting agencies are increasingly adopting
cloud-based services.
2 Paper Organization
The rest of the paper is organized as follows. In Sect. 3, basics of virtual machines
have been discussed. In Sect. 4, Docker containers’ working and basics have been
discussed. In Sect. 5, these two virtualization techniques are compared, and finally,
the paper concludes in Sect. 6.
3 Virtual Machines
All the virtual machines are managed and controlled by virtual machine managers.
These are generally termed as VMM or hypervisor, and their main focus is to provide
abstraction to the underlying hardware. The system on which VMM is installed or
run is termed as host machine, and all other virtual machines running inside the host
machine are termed as guest. Both host and guest use almost same interface for using
the different applications. Host machine and all the available guest machines running
on host machine are independent of each other [6].
There are various hypervisors provided by different organizations. These hypervi-
sors are capable of controlling the hardware and create a secure virtualized environ-
ment for users to work upon. These hypervisors can be divided into two categories:
Type 1 and Type 2.
Type 1 hypervisors basically run on the top of system hardware, and due to this,
they are named as native virtual machine. In other way, we can say this Type 1 hyper-
visor takes the place of OS and they can directly access the available hardware for
their use. Type 1 hypervisors have one favour that if any virtual machine fails or does
not respond for any reason then other guest OS does not get affected. Type 1 runs in
kernel mode and because of which has exclusive physical CPUs. Examples of Type
1 hypervisors are Microsoft Hyper-V, VMware ESXi Server, Citrix/Xen Server, etc.
On the other side, Type 2 hypervisors run within the OS installed on top of hyper-
visor or in other words we can say they are just like any other application software
which runs under OS. Type 2 hypervisors are also known as hosted virtual machines.
Examples of Type 2 hypervisors are Microsoft Virtual PC, VMware Workstation,
and Oracle Virtual Box, etc. [7].
There are several benefits of using virtual machines; some of the benefits are as
follows:
• As there are many virtual machines running on a single host machine, they
have their own basic security zones which cannot be accessible via other vir-
144 A.K. Yadav et al.
tual machines. In addition to this, there is one security layer of hypervisor as well,
so we can say there are many security zones available to provide the security [8].
• In virtual machines, all the OS are isolated as well as their applications. This
isolation provides better separation between the application and various activities
of operating systems.
• Virtualization provides better resource utilization and improved performance as
compared to traditional systems. All the underutilized resources can be used in
much more efficient way by using virtualization.
• Virtualization provides better fault-tolerant environment as compared to traditional
systems as if there is any server failure due to any reason, there are other servers
that are available to work upon.
• Virtualization also reduces the many server requirements as it can be implemented
using various virtual machines.
• Process migration is one of the major advantages provided by the virtual machines.
Processes can be migrated at run-time from high-loaded virtual machines to less-
loaded virtual machines. This process migration helps in saving of energy and
balancing of loads. Another advantage is that due to this migration, no activity got
disrupted.
• Traditional data centres generally have large pool of computing resources, and
with the increasing demand, the capacity of various resources also needs to match.
Due to this, large amount of energy is required to operate those systems as well
as to keep them cool. With the use of virtual machines, the requirement can be
minimized and resource utilization becomes efficient. And most importantly, this
is also helpful for the environment.
Apart from various benefits as discussed, there are several issues as well that needs
to be taken into consideration while opting for virtual machine-based solution.
• Virtual machines generally share their data and interact with each other, so if the
communication is not secure, then it can be exploited by the attacker and which
in turn leads to security-based attack.
• Like other technologies, virtualization also has possibilities of attacks due to vul-
nerability like buffer overflow.
• There is a single point of failure in Type 1 hypervisor as there exists a single
hypervisor. If hypervisor stops working, then the entire system gets affected.
• While using virtualization in cloud computing, one data needs to be stored far
away from the local machine, and also data generally moves time-to-time from
one tenant to another tenant. This movement leads to concern of leakage of data,
and it can be a risk from security point of view [9].
• As Internet connection is the basic requirement of virtualization-based cloud com-
puting, it can lead to various kinds of security risks.
Docker Containers Versus Virtual Machine-Based Virtualization 145
4 Docker Containers
Docker is an open-source project that is used for automation in a systematic way for
fast deployment of applications running under a container. Docker engine is required
to run the Docker containers like VM runs inside hypervisor.
Containers are a more lightweight virtualization concept, i.e. less resource- and
time-consuming [10, 11]. They can be seen as more flexible tools for packaging,
delivering, and orchestrating both software services and applications. Containers are
built on recent advances in virtualization and therefore allows for better portability
and interoperability while still utilizing operating systems’ virtualization techniques
[12]. Docker container is just like a directory. It contains all the things that are
required for an application. In containers, isolation is done at kernel level. Docker is
a platform that is used to design, deploy, and run various applications. With the help
of Dockers, applications can be isolated from the available infrastructure and user
can view the infrastructure as a managed application [13].
In recent times, OS-based virtualization gained popularity in terms of software
to run predictably and transferring from one environment to other. By using the
containers, all these isolated systems can be run on a single host operating system.
Containers lie on top layer over a server and its host operating system. Operating
system can be Windows or Linux or any other operating systems. Every container
not only shares the host OS but also the libraries and binary files as well that are
required for application to run. All the shared components are generally read-only,
and due to this, containers are lightweights, just some Mb in size. As the containers
are less in size, they need few seconds to start up. By using the Dockers, jobs of
application developers and system administrators become simple [14].
There are different containers models or we can say delivery models according to
the different operating systems. Few of them are listed as:
• Linux: Docker, LXC Linux containers, OpenVZ,
• Windows: Sandboxie,
• Cloud PaaS: Warden/Garden (in Cloud Foundry), LXC (in Openshift).
146 A.K. Yadav et al.
By the invention of virtual machines, various issues related to cloud computing like
scheduling, packaging, resource management have been resolved. As the applications
can be made isolated with the help of virtual machines, due to this security can be
improved [15]. Cloud needs to answer the requirements of application management
and packaging. Containers can give solution to these requirements in efficient way.
A container is a package that contains ready-to-deploy application parts, business
logic, and middleware as shown in Fig. 1 [16].
Containers are highly scalable and safe to use. These are easy to deploy when
we compare it with the virtual machines. So we can say Docker is an open-source
platform that helps users and programmers to isolate application dependencies.
Both of these technologies generally provide an illusion that a single host machine
can be used to run multiple machines. All of these machines running under the host
machine need to be isolated from one another and also from the host machine. The
difference comes in that how both of these technologies are able to achieve isolation
between the different machines. A brief difference is shown in Fig. 2[17], according
to which we can say that containers generally are executed on host OS and virtual
machines run on hypervisor. A container engine is generally combined with the
kernel of the host OS.
Further, both of these can be compared based on certain factors like:
Docker Containers Versus Virtual Machine-Based Virtualization 147
Operating System Support: As per the architecture for both the virtual machine
and Docker containers, the operating system support differs. A virtual machine con-
tains a host OS which is able to run multiple guest OS inside different virtual
machines, whereas containers need to be hosted on a single server that contains
a shareable OS. The guest OS can be anything irrespective of the available host OS.
On basis of this, we can say that both of these technologies can be used in different
situations according to the requirement. If one wants to run many applications on
a single OS kernel, then Dockers need to be preferred, and when user has many
applications that need support of different operating systems, then virtual machines
should be preferred. As the host OS is shared between the containers, it leads them
to boot in very short span of time. So we can say maintenance overhead of containers
is less than virtual machines [17].
Host/Guest Architecture: Virtual machine provides the facility to run the guest
kernel that is different from the host kernel; that is not possible with containers as
kernel needs to be shared.
Booting: Booting started as it starts in normal operating system, and the speed
depends on the applications. Containers can start up rapidly when we compare it
with virtual machines as they are less resource-centric.
Standardization: Virtual machines are generally like a complete standard operat-
ing system having all the features. On the other hand, containers are more application-
specific [18].
Portability: Docker containers are the separate package which can run the needed
application. As Dockers do not contain any separate operating system, so applications
can be ported out easily across various platforms which is not possible in case of
virtual machines. Containers can be switched on and off within seconds, much faster
than that of virtual machines, because of their lightweight nature. Due to this feature,
containers can be easily deployed on the servers. Virtual machines on the other side
148 A.K. Yadav et al.
are separate server instance that is isolated with their operating system. It is not
possible to port the virtual machines across various platforms due to compatibility
issue. So we can say for the developers where application development is the primary
focus, Docker containers need to be preferred.
Need of Servers: Multiple server requirements in Dockers are not as much as
compared to virtual machines. As Dockers are lightweight and contain only the
applications, there is no need of multiple servers. These applications can run on a
single physical server. But if user needs to run multiple applications on different server
instance and these servers need specific operating system, then the user needs the
virtual machines. Virtual machines contain all the necessary library files, supporting
files, and most importantly the entire operating system to work upon which is required
by the particular application. So we can say lesser number of virtual machines can be
accommodated to the same server if we compare it with the Dockers. As the number
of virtual machines hosted on a single server is less than Dockers, we can say that
the server density is lesser with virtual machines. Due to this feature, one can say
that Dockers are cost-effective application hosting solution when we compare it with
virtual machines.
Performance Evaluation: Both of the virtualization techniques have their specific
purposes so comparison of performance evaluation is not fair.
But we can say as the containers are lightweight virtual architecture, they are
less resource-intensive when we compare them with virtual machines. Due to this,
start-up time of containers is very much less than that of virtual machines. Resource
allocation in containers is not permanent as resource usage can vary with the load.
Replication and elasticity are also much easier in containers in comparison with
virtual machines as containers do not require a separate operating system.
Security: Security can be an overhead in the case of Dockers, as the host kernel is
shareable among all the containers, so a single vulnerable point can lead to hacking
of entire server. Due to this security concern, superuser access to the applications
and also running them with root user privileges are not recommended. While in the
case of virtual machines such applications are run, those need more security and
privilege. Apart from this as we know that each virtual machine runs under separate
or its own operating system, due to which they can use their own security features
and kernel features.
Low Redundancy: Containers just need the applications to run on host operating
system unlike virtual machines where entire operating system needs to install before
proceeding. This results in lots of duplicity of various components. Thus on the basis
of this, we can say that containers result in low redundancy when we compare them
with the standard virtual machines.
Hardware Access: Applications that run under the containers have direct access
to the hardware, which is not possible with virtual machines.
Resource Distribution: Containers generally require very less resources, only
those which are required at that particular time, unlike virtual machines which require
permanent resource allocation before start-up of virtual machines. So we can say
resource distribution is optimal in case of containers [19].
Docker Containers Versus Virtual Machine-Based Virtualization 149
Memory Usage: Virtual machines need complete operating system for each of
the guest, due to which it requires large memory when we compare it with containers.
Containers use less memory as it shares the host operating system.
Files and Library Sharing: Each virtual machine has its own OS, which contains
large number of files and libraries. These files cannot be shared between different
virtual machines. On the other side, containers run under host OS, no separate OS
is needed by each application. So files and libraries can be shared using Linux
commands.
All these differences are summarized in Table 1.
In this paper, virtual machines are compared with containers on the basis of vari-
ous parameters. Both the techniques are based on virtualization and solve specific
purpose; in some cases virtual machines can be used and in some cases containers
150 A.K. Yadav et al.
References
1. Ranjan, R.: The cloud interoperability challenge. IEEE Cloud Comput. 1(2), 20–24 (2014)
2. Goldberg, P.: Survey of virtual machine research. IEEE Comput. 7(6), 34–45 (1974)
3. Soltesz et al.: Container-based operating system virtualization: A scalable, high-performance
alternative to hypervisors. ACM, 41, 275–287(2007)
4. https://www.taksatech.com/containers-vs-vms/
5. Di Martino, B.: Applications portability and services interoperability among multiple clouds.
IEEE Cloud Comput. 1(1), 74–77 (2014)
6. Silberschatz, P.B. Galvin, Gagne, G.: Operating System Concepts, 9th ed. ch. 8.5, 16,
pp. 366–377, 711–740. ISBN: 978-1-118-06333-0, (2013)
7. http://www.golinuxhub.com/2014/07/comparison-type-1-vs-type-2-hypervisor.html
8. Sarna, D.E.Y.: Implementing and Developing Cloud Computing Applications. Taylor and Fran-
cis Group, LLC (2011)
9. Almond C.: A Practical Guide to Cloud Computing Security (2009)
10. Scheepers, M.J.: Virtualization and Containerization of Application Infrastructure: A Compar-
ison. In: Presented at the 21st Twente Student Conference on IT, Twente The Netherlands June
23 (2014)
11. Pahl, C., Lee, B.: Containers and clusters for edge cloud architectures-a technology re View
(2015)
12. Ranjan, R.: The cloud interoperability challenge. IEEE Cloud computer. 1, 20–24 (2014)
13. https://docs.docker.com/introduction/understanding docker/
14. Merkel, D.: Lightweight linux containers for consistent development and deployment. Linux
J. 239, 2 (2014)
15. Mao, M., Humphrey, M.: A performance study on the VM startup time in the cloud. In: 5th
International Conference on Cloud Computing (CLOUD), IEEE, pp. 423–430. (2012)
16. Soltesz, S., Pötzl, H., Fiuczynski, M.E., Bavier, A., Peterson, L.: Container-based operating
system virtualization: a scalable, highperformance alternative to hypervisors. ACM SIGOPS
Operating Systems Rev. 41(3), 275–287 (2007)
17. https://bobcares.com/blog/docker-vs-virtual-machines/
18. Bernstein, D.: Containers and cloud: from LXC to Docker to Kubernetes. IEEE Cloud Comput.
1(3), 81–84 (2014)
19. http://www.channelfutures.com/technology/docker-vs-virtual-machines-understanding-perfo
rmance-differences