In: Computer Science
Docker containers can be considered a new era of virtualization that has fundamentally changed the IT industry. For this discussion question, provide a brief response that describes a Docker container and how a container differs from a hypervisor.
Docker containers Indeed has changed the IT industry.Earlier the
Applications were monolithic and build on a single stack such as
.NET or Java.These applications were then deployed on a single
server. Due to this the applications used to take long time to
develop.Even if these applications were loadbalanced,they still had
a monolithic structure.
However these days the applications are constantly
developed. You will see updates and security patches for each part
of the application.The applications these days are build with
loosely coupled components rather than tightly coupled component as
it was in monolithic. The applications these days are deployed on
multiple servers as well.
Now lets understand the concept of containers with a help of an
example.
Suppose you are building an application.Your application is built
of lot of small parts.All these small parts are called micro
services. You have a web server,a database server,you have a
shopping cart service and maybes some data analytics. I am pretty
sure you can install this in any production datacentre. But the
main question arises is -Would it look the same if you ran it in
your development environment or could you deploy your application
just like you have it in your production environment on
cloud-either public or private?
To make this easier,we use containers.
-Containers make your application portable.It looks same
everywhere,no matter where you run it,be it your cloud,datacentre
or the production environment.Also another advantage that
containers provide is that you dont need to install application
dependencies on your host(If you have dependencies in your
application of each part,they start conflicting with each
other).
-Container includes everything your application needs which include
libraries,binaries and file systems.
-Containers uses the host for certain things like networking for
instance and it also requires a kernel to run application so it
uses a host kernel for that
-A Container in a dockerized format makes your application very
shareable.The entire needs of an application is defined in a text
file called docker file.A docker file is easy to read and
understand even if you dont know docker.
-Why containers are Awesome to use?
a) You can use them for next application that you are
developing.
b)You can use thousands of already existing applications.
c)They will always look the same no matter where you deploy
them.
d)They are always portable so that you can always use same image or
the same container on your laptop,in your lab or the
production.
e)They are lightweight.
f)The Booting of containers are very fast.
g)It can Start,Stop,Kill,Remove Containers easily and
quickly.
h)The resources of the operating system can be shared within the
docker.
-Containers Vs hypervisor
With Virtualization,both hypervisor and container are eliminating
the need of physical hardware. They are improving the efficiency of
compute and help us in meeting the Speed and the Scale.
1. There is no requirement of Guest Operating system in Containers
whereas it is needed in Hypervisor. Guest operating system is a key
requirement in Hypervisor as it emulates the resource of the
application while in containers,they use this resource from the
host operating system.This allows containers to access a bigger
resource pool.
2. Containers are at least 9 Times faster than the
Hypervisor as we dont need to boot up any additional operating
system
3. The VM(Hypervisor) virtualize the Hardware and the container
virtualize the operating system.This makes Containers more portable
and efficient as there is no OS based dependency in Containers we
have much better integration here.
4.With help of docker,containers are highly powerful and extremely
portable.The container is a world in itself,the code can be reused
again.Containers are also called as Build once and Run
anywhere.
5.When bootup the application,A hypervisor can take minutes to
start whereas a Containers takes milliseconds to
start.
6.You waste a ton of disk space as you require a guest OS in
Hypervisor whereas the Containers directly runs on the Host
OS.Therefore there is wastage of resources in Hypervisor.
7. Vm's or the hypervisor are bigger in size as compared to
Containers.
-However Both Hypervisors(VM's) and Containers (Docker) have different use cases in my opinion.Virtual machines are very good at isolating system resources and entire working environment.For example,if you owned a web hosting company,you would likely use Virtual machines to separate each customer whereas Docker Philosophy is to isolate individual applications not entire systems