0% found this document useful (0 votes)
18 views

Economically Efficient Virtualization Over Cloud Using Docker Containers

This document discusses the use of Docker containers for efficient virtualization over cloud computing environments. It describes how Docker containers provide lightweight virtualization at the system level using Linux container technologies like namespaces and cgroups. This allows Docker containers to share resources from the host operating system, reducing overhead compared to traditional virtual machines. The document provides details on the Docker technology, components, and elements. It also gives examples of how Docker containers can be used for portable application deployments, code portability, and debugging across different environments with low overhead.

Uploaded by

Rejnis Spaho
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Economically Efficient Virtualization Over Cloud Using Docker Containers

This document discusses the use of Docker containers for efficient virtualization over cloud computing environments. It describes how Docker containers provide lightweight virtualization at the system level using Linux container technologies like namespaces and cgroups. This allows Docker containers to share resources from the host operating system, reducing overhead compared to traditional virtual machines. The document provides details on the Docker technology, components, and elements. It also gives examples of how Docker containers can be used for portable application deployments, code portability, and debugging across different environments with low overhead.

Uploaded by

Rejnis Spaho
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/312568688

Economically Efficient Virtualization over Cloud Using Docker Containers

Conference Paper · January 2017


DOI: 10.1109/CCEM.2016.025

CITATIONS READS
14 121

2 authors:

Krishan Kumar Manish Kurhekar


National Institute of Technology (NIT) Uttarakhand Visvesvaraya National Institute of Technology
31 PUBLICATIONS 193 CITATIONS 25 PUBLICATIONS 295 CITATIONS

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Affective computing View project

LEXER: LEXicon based Emotion analyzeR View project

All content following this page was uploaded by Krishan Kumar on 17 April 2019.

The user has requested enhancement of the downloaded file.


2016 IEEE International Conference on Cloud Computing in Emerging Markets

Economically Efficient Virtualization Over Cloud Using Docker Containers

Krishan Kumar Manish Kurhekar


National Institute of Technology Uttarakhand Visvesvaraya National Institute of Technology
Srinagar Garhwal, India Nagpur, Maharashtra, India
Email: [email protected] Email: [email protected]

Abstract—In computing era, a virtual version of a stratagem will scuttle virtually anywhere. Such Docker containers
or resource, such as computer network resources, server, can encloses any payload, and will run coherently on and
storage device, or a combination of these usually refers as between virtually any servers. A developer can build and
virtualization where the framework segregates the resources
into one or more execution instances. A Virtual Machine test with the same container on a laptop which will run with
(VM) created on the host hardware as a software is called scalability, VMs, public instances, in production, on Open-
a hypervisor or a VM manager. Nowadays, hypervisor based Stack clusters, bare metal servers, or combinations of the
virtualization is the most prevailing technology for virtual above. Docker is a uniting block for automating distributed
environment. It is supple and performs for equivalently any systems: database clusters, large scale web deployments,
guest operating system (OS) but it leads to overload on
memory and CPU. Nevertheless, container based virtualization continuous organization systems, creation of lightweight,
(or OS virtualization) technique which allows various different private PAAS environments, service oriented architectures,
VMs employed on top of running kernel. Unalike the existing packaging automation and applications deplopment, testing
virtualization approach, a containerization does not execute a automation and continuous deployment/integration, scaling
VM as a complete OS instance but runs as partial instances and deploying web apps, backend and databases services.
of the OS which reduces the CPU and memory overload and
also provides the portability due to small size of containers. II. D OCKER T ECHNOLOGY
Docker is a tool to make Linux Containers (LXC) easier
to use. Docker containers could be specifically deployed for Docker is an open source platform that organize auto-
the applications and systems deployment using lightweight matically of any application as a self sufficient, portable,
containerization technique which results reducing economical light weight container that will surries virtually anywhere[1].
overload instead of VMs over Cloud.
It utilizes namespaces, cgroups and AuFS as underlying
Keywords-Docker, Container, System Level Virtualization, technologies.
Cloud, Virtual Machines, LXC.
A. Underlying Technologies
I. I NTRODUCTION The competence of Docker occurs from the underlying
Docker[1] is a tool which renders the lightweight vir- technology[2] it is assemble from. The summarizes foremost
tualization at system level through extending a common OS traits that Docker operate to deploy easy containerization
container format approach on Linux called Linux Containers happen as follow: a) Namespaces provide an isolation to
(LXC). It employs cgroups, LXC, and the Linux kernel container. When we launch a container instance, Docker con-
itself unlike conventional VMs, a Docker containers do cocts a namespaces sets for that instance of the container[3].
not include a separate OS. Even, it hastens in the same This allots a isolation layer where processes with the fallacy
OS as its host. This enables Docker to share the host OS that they are the only processes on the system. b) Control
resources and bargains on the kernel’s functionality which is Groups (CPU, Memory, I/O, Device etc.) enforce resource
provided by the underlying LXC and cgroups technologies accounting and limiting for Docker containers. Applications
that offers resource isolation (memory, CPU, I/O, network, which are running in isolation is to have contained them, not
etc.) which reduce the CPU and memory overload. It also just in terms of pertained file system and/or dependencies,
proffer the portability due to small size of containers. but also, resources. Docker empower by control groups to
Hence, a container based virtualization framework is an fairly allotment of the hardware resources available to that
easy, lightweight virtualized environment where it tolerates containers. and c) AUFS (Union File System) manoeuvres
us to create containers holding all the dependencies for through building layers, which furnishing them fast and very
portable applications. It automates s a portable, lightweight, light weight even. Docker utilizes file systems (e.g. union)
self sufficient container deployment of any application that to produce the elementary blocks for Docker containers.

/16 $31.00 © 2016 IEEE


978-1-5090-4573-0/16 $31.00 © 2016 IEEE 96
95
DOI 10.1109/CCEM.2016.24
B. Docker Components D. Docker Use Case
Docker employs the server client architecture[3]. Both
the client at Docker and daemon (server) able to jog on Docker allows to launch many more containerized in-
same OS or the client of Docker interacts with Docker stances on single OS possible with almost zero overhead.
daemon remotely through RESTful API or sockets. The The use cases[6] which make Docker engine render a
major components[4] of Docker are as follow: a) Docker steady environment at a very low overhead: 1) Elucidate
client as the paramount user interface to Docker. It is Layout is the most significant benefit of VMs with its own
worked via accepting commands from user on terminal over configuration is the capability to run any platform on top
http and liaising back and forth with Docker daemon to of the framework where Docker does the same without the
govern container lifecycle on any host. b) Docker daemon overhead of a VM. To set the environment and employ
perform its operation on a host machine where users do it then the same Docker configuration can be utilized in
not communicate directly with daemon, however, instead via a variety of environments. This dissociates infrastructure
an intermediary (client of Docker) over http. The daemon, essentials from the application environment. 2) Code Porta-
collecting these commands, does the appropriate job, for e.g. bility feature of Docker make a large impact to manage
run a container; stop a container. and c) Docker registries the code shipping. Docker renders a steady environment
are the dissemination component of Docker which clutchs to the application from client’s machine to server and vice
the images. These registries are public or private inventories versa, to make easy the code development and deployment
that we able to download or upload images from and to. pipeline[7]. 3) Debugging Abilities of Docker proffer a lot
of tools that are not specific to containers, but, they perform
C. Docker Elements the tasks well with the abstraction of containers. Hence,
The foremost elements [5] of Docker describe as follow: This make exceedingly useful in fixing an application[7]. 4)
a) Docker containers look as directories which consists of Fast Production in computing environment, the development
a mini OS (without kernel part), user added files and meta to be fast as much as possible for interactive use and
data run in host OS, is called light weight VM. Container also closest to production but there is tradeoff to achieve
life cycle is shown in figure 1. Docker containers carry these goals. However, there is no need to bear addition
overhead of toiling remotely on compilation every time and
an Internet connection. Here, we come to know that Docker
work with the zero–overhead because Docker smoothly
tolerates a few dozen services to execute within Docker.
5) Isolation Approach where multiple applications can run
on the same machine at a time without any issue. We
discussed earlier an example of the developer productivity
flow. But there are other reasons, too. A couple to assess are
server consolidation for abating cost or a leisurely plan to
segregate a monolithic approach into decoupled pieces. 6)
Server Consolidation just like to acheive consolidation over
multiple applications using VMs. However, without memory
footprint of multiple OSes and the capability to spilt unused
memory across the instances, Docker dispenses far denser
server consolidation than using VMs[8]. 7) Multi–Tenancy
feature help us to avoid major approach rework becuase
Figure 1: Docker container creation cycle restructuring an application is not only time consuming,
but also wastage a lot of money. Docker make easy and
everything i.e. required for to run an application (except inexpensive to create lonesome surroundings for executing
the kernel part of OS because Docker container confides multiple instances of app tiers for each tenant. It happened
on host kernels functionality). b) Dockerfile grasps Docker through the turn up speed of Docker environments and
commands (FROM, RUN, CMD etc.) which aid to create a its potent different command[9]. and 8) Rapid Deployment
Docker image. Docker can work as a builder and execute which help to enhance the speed of computing, Docker
instructions with automatic steps from a Dockerfile text, launches a container to perform a task and no need to bootup
otherway Docker image can created manually from scratch. an OS, brings it down to seconds. Hence, we can create and
and c) Docker Image dispenses the build portion of Docker. destroy resources in data center without worrying about the
Docker supplies a simple way to update existing images or cost of recovery. With archetypal data center of Google and
build new images from scratch. It is a template, for e.g. an Facebook utilization at 30%, it is not difficult to bounce up
Ubuntu OS with Apache and a web application installed. that number by using a more hostile resources allotment.

96
97
III. C LOUD C OMPUTING at Cloud. Its configuration may use for different backend
As per the definition of National Institute of Technology storage services which holds up various formats of VM
and Standards (NIST), ”Cloud computing[10] is a frame- image like ISO, virtual disk image, etc.
work to enable suitable, accessing the network on demand IV. I MPLEMENTATION
to share a configured pool of computing resources which are
rapidly released and provisioned which need less effort to First of all, OpenStack has installed with ubuntu 12.04 on
manage or to make interaction with service provider” our host machine with OpenStack installation steps[13] and
then install the Docker with installation steps[14]. Next, the
A. Cloud Service Framework amalgamation of Docker and OpenStack Cloud follows as:
Basic services model[11] for Cloud computing is de- A. Docker with OpenStack Cloud
scribed as follow: 1) a Service using Infrastructure (IaaS)
renders accessing the underlying resources like as virtual We have deployed OpenStack and named it ”dCloud”
machines, virtual storages, physical machines etc. 2) a Ser- considering containerization instead of creating VMs.
vice using Platform (PaaS) dispenses a runtime environment It provides us facility to create Docker Container with
for applications, evolution and deployment tools, etc. and 3) extensive network capabilities. Docker easily performs push
a Service using Software(SaaS) proffers to the end users a
service through software.
B. OpenStack Cloud Computing Environment
OpenStack[12] is developed as computing project at
Cloud which has an aim to render a service using infras-
tructure (IaaS). It is a heap of projects which are using
the open source that can be utilize to execute and setup a
computating environment. It is devised to jog on commodity
hardware e.g. x86 and arm. The management competencies
of the OpenStack in Cloud environment (see figure 2) is
computing, storage and networking service altogether.
(a) Docker virt Driver (Hypervisor)[15]

Figure 2: OpenStack Services

C. Openstack Services
In OpenStack, a computing controller node at Cloud is
known as Compute (Nova)[13]. Object and Block storage
of OpenStack at Cloud is used by VM instances for storage
services. The users are granted by the block storage service
to make storage devices through block where attachment and
detachment them from VM instances is done dynamically to (b) Building Docker Image from Dockerfile
utilize the API or dashboard services. OpenStack networking
dispenses software driven network. Dashboard or horizon
service is Python based service which is used to manage
the services for OpenStack. Individual identity in OpenStack
donates the authorization and authentication services for all (c) Launching an instance of Docker Container
activities in OpenStack. OpenStack Image (Glance) works
as storage object and retrieval from it as the images of VM Figure 3: Working of Docker with OpenStack Cloud

97
98
and pull images operation from OpenStack storage using using radius server. The result then would collect in resulatnt
an amalgamated Docker registry with nova and glance (see container (CR) at controller node. Hence, we will able to
figure 3(a)). The driver at Nova sets with a small client of get the entire result in one CR at controller node. Suppose
HTTP which communicate with Docker using an internal some computing node become overloaded due to very large
API Rest or via socket of UNIX to govern Docker containers number of containers, we can then transfer some container
and collect information about them. The configuration to to another computing node for balancing the load which is
enabe Docker is as follows: Nova is configured for very easy using Docker registry (see figure 4).
the use of virt driver of Docker. So, configuration file
of Nova needs to be edited ”/etc/nova/nova.conf” with V. E XPERIMENTS AND R ESULTS
”compute driver=novadocker.virt.docker.DockerDriver” A. Tool installation in Docker Container:
whereas Glance is configured to make the Using the commend ”# apt–get install to install –y pack-
compatibility the format of Docker containers. So, age name”, we can install any essential tools inside Docker
configuration file of Nova needs to be edited using container. We are installed nano as an editor inside Docker
”container formats=docker”. Docker container can be container (see figure 5).
created either by Docker Binary Image or Dockerfile.
We create own Dockerfile and the content is availbale at
”https://registry.hub.docker.com/u/dockberwal/dock–berwal/
dockerfile/”. We built Docker Image (see figure 3(b))
using ubuntu with Docker command ”# docker build
–t dockberwal/dock–berwal .” where Docker Image
need to tag with dockberwal/dock–berwal. To launch
an instance of Docker (see figure 3(c)) using image
dockberwal/dock–berwal where i, t are the options which
make interactivity between host machine and Docker
container.

B. Container based virtualization Over Cloud


The paper aims to expose the container based virtualiza-
tion over Cloud where we can distribute the computation Figure 5: Installing a tool inside Docker container
among containers to achieve high performance the tasks to
be execute in parallel. We create some containers instead of
B. Problems resolved associated with Docker Containers:
VMs to achieve high performance with zero overhead. Here,
we created two specific node types: 1) Computing node and We have resolved the following problems associated with
2) Controller node as shown in figure 4. The Controller node the Docker containers: i) Network configuration problem:
created to govern the other computing nodes. We created a Docker conatiners are not working well behind proxy.
container as server resultant (CC) which collects the result To resolved this issue, we have export the proxy in-
from other containers called local containers at computing side the Docker container using the commend ”# export
node where every CC can communicate with each other http proxy=http://Y.Y.Y.Y:YYYY”. So that internet is reach-
able inside Docker container behind proxy. In later, we
tried by mentioning the proxy inside Dockerfile itself using
the command ”ENV http proxy http://Y.Y.Y.Y:YYYY”. and
ii) Preserving the states of Docker container (Dump and
Restore): eight instructions (see figure 6) are impemented to
save the container state, on the wake of a certain event. The
event can be as small as an I/O branching or as large as

Figure 4: Docker containers over Cloud Figure 6: Dumping and Restoring mechanism

98
99
a system crash. We simulated this situation by considering
a shell script abc.sh executed inside the created Docker
container to print numbers from 1 through 50 and to take
user input two times after printing 21 (see figure 7(a)) and
42 (see figure 7(d)). When the I/O branching for user input
has to take place, we will stop the container which runs the
current program and then restart after the user input process
is complete and continue to print number 22 onwards, so
that our container will be able to start from the previous
state where we had stopped. Therefore, We get the process
id which belongs to the running container using command
(see figure 7(b)). CRIU (Checkpoint/Restore In Userspace)
call to set the sh –job, as, a part of a session will dump
(a) Running Container with an application and a slave TTY endup from TTY pair. Hence, to dump
the session of process (e.g. PID 8987) by detaching it from
other terminal session or dependent jobs through shell job
and there is everything fine then return the message OK.
(b) Processes running inside Docker container We have stored the pages in form of images. Dump.log
(see figure 7(c)) and restore.log are two main files where
dump.log file contains the stack, ptrace, and syscall address
etc. while restore.log file resolves the address and gets the
dumped data from other images first and then restores the
entire state. Now, we try to restore the entire state back.
After restart the container, it must complete the I/O and
print 22 as next number (see figure 7(d)). Thus, container
is restarted with previously stored state successfully. Hence,
we can pull again anywhere and run the container from the
crushing state.

C. Comparing Docker Containers versus Virtual Machines


We compared VMs with Docker containers by analysing
their size, application or hardware–centeric, prtability and
performance as the parameters. However, there are no avail-
able proper tool for cost calculation and analysis in Cloud
(c) Content of dump.log file environment[16]. The comparisons are delinated as follows:
a) Size of VMs large which make it unable to ship whereas
Docker containers are small to ship. b) Hardware–centric,
VMs were devised as machine oriented but not software.
Therefore, they proffer vary limited tooling for software
development. But Docker containers are originated from
the ground up with an application–centric design with fa-
cilities of application as versioning, monitoring, or service
discovery. c) Portability Even VM environments have con-
version tools but they are limited with more overhead but
Docker containers are completely portable with almost zero
overhead. d) Performance Running VMs devours significant
CPU and memory, which makes them unserviceable in many
scenarios such as evolution of multitier applications, and
(d) Preserved state of Docker container large scale utilization of CPU. However, Docker containers
Figure 7: Preserving the container state through (a) to (d) have approximately zero CPU and memory overhead or very
less in comparison to VMs. Morevover, the comparison be-
tween VMs and Docker containers with varoius parameters
is shown Table 1.

100
99
Table I: Comparison of VMs versus Docker containers [3] Krishan Kumar, Docker Inroduction : basics, [Online Avail-
able:] https://www.youtube.com/watch?v=18LTGgTlKwAr.
Virtualiza– Start Stop Time to Max. Overhead Retrieved Feb. 2016.
tion time time launch a instances [Memory,
Technique [sec.] [sec.] instance per I/O,CPU, [4] Docker‘s Architecture: Major Docker Components, [Online
[min.] machine etc.]
Available:] https://docs.docker.com/introduction/understanding
VMs 30–40  5–10 >20 <10  1 OS –docker/#what–are–the–major–docker–components. Retrieved
Containers <0.005 <0.005 <0.5 >100 1 process May 2016.
( Zero)
[5] Elements of Docker : Contianers, Images and Dockerfile, [On-
line Available:] http://docs.docker.com/introduction/working
D. Docker versus KVM Network Performance –with–docker/#elements–of–docker. Retrieved March 2016.
KVM uses the less bandwidth than Docker with dedicated [6] Potential use of Docker in Digital Era, [Online Available:]
Port. However, Docker with port forwarding utilize approx- http://blog.flux7.com/blogs/docker/8–ways–to–use–docker–in
imately less than 50% bandwith in comprison of KVM –the–real–world. Retrieved Dec. 2015.
bandwidth 31 Gb/s. The network performance of Docker
against KVM over Cloud is shown in figure 8. [7] Dana P., Interoperability and Portability betweens Clouds:
challenges and case study 4th European Conference Pro-
ceedings, ServiceWave 2011 Poznan, 6994, 2011, pp 62–74

[8] Marzolla M., Babaoglu O. and Panzieri F., Server consolida-


tion in Clouds through gossiping, World of Wireless, Mobile
and Multimedia Networks (WoWMoM), IEEE International
Symposium on, Lucca, 2011, pp. 1–6.

[9] F. Zhang, J. Chen, H. Chen and B. Zang, CloudVisor:


Retrofitting Protection of Virtual Machines in Multi tenant
Cloud with Nested Virtualization, Proceedings of 23rd
ACM Symposium on Operating Systems Principles, 2011, pp.
203–216.

[10] Peter M. and Timothy G., Definitiong of


Cloud Computing from NIST, [Online Available:]
http://csrc.nist.gov/publications/nistpubs/800–145/SP800–145.
pdf. Retrieved Dec. 2015.

[11] Cloud Computing Overview, [Online Available:]


http://www.cloudcomputingtraining.co.in/cloud–computing
–overview/. Retrieved Jan. 2016.
Figure 8: Network throughput of KVM and Docker
[12] Kevin J. and Cody B., Cookbook for OpenStack in Cloud
environment PACKT Publisher, BIRMINGHAM, 2013.
VI. C ONCLUSION [13] Installation Guide for OpenStack 12.4 Ubuntu (LTS),
We have concluded that containers have the large scalabil- [Online Available:] http://docs.openstack.org/havana/install
ity; and safe to develop and utilize as compared to previous –guide/install/apt/content/index.html. Retrieved July 2015.
technique. They may run through Docker technology instead
[14] Docker installation on Ubuntu 12.04, [Online Avail-
hyper–visor which are smaller in size and enable speedily able:] https://docs.docker.com/installation/ubuntulinux/. Re-
to launch, run, stop, restart with superior execution, little trieved Aug. 2014.
isolation and more concord potentially due to sharing of
kernel of the hosts. However, VMs have a entire operating [15] Configure an existing OpenStack to enable Docker, [Online
system including its own memory installed and the associ- Available:] https://wiki.openstack.org/wiki/Docker. Retrieved
Aug. 2014.
ated overhead for drivers of virtual device.
R EFERENCES [16] Li X., Li Y., Liu T., Qiu J. and Wang F., The Method and Tool
of Cost Analysis for Cloud Computing, IEEE International
[1] Commencement of Docker, [Online Available:] Conference on Cloud Computing, 2009, pp. 93–100.
https://www.docker.com/whatisdocker/. Retrieved Jan. 2015.

[2] The underlying technologies for Docker : Namespaces,


Control groups and UnionFS, [Online Available:]
http://docs.docker.com/introduction/technology/#the–underlying
–technology. Retrieved Feb. 2015.

100
101

View publication stats

You might also like