Translate

Total Pageviews

My YouTube Channel

Wednesday 28 August 2019

What is Container? - Part 3

What is Container?
Container is an Instance of Docker Image that runs the program. Container Lets you to run two different applications those who are dependent on Same Application but they need two different versions of same application. Like App1 need Python V1 and App2 needs Python V2. Due to OS level constraints you cannot run two different versions of same application. With container it is Possible.

Container Architecture
First of all for understanding the container architecture one should know how our apps interacts with resources in general.
1. Whenever Application is launched within the OS, it starts processes and these processes will start the system call to read the data from hard disk.
2. OS Kernel receives this call and checks which process is making the call and accordingly provides the resources.

Now as the example given by me earlier what if i want to run two different applications where they have dependency on two different versions of same application. How container solves this problem:-

1. In Container with Namespaces one can Isolate resources for per process. we can configure this process should use this particular Hard-disk area. 
2. with cgroups, which process can use how much RAM, CPU, HDD Space and Network Resources.
3. Now whenever someone runs "docker run" command, it creates container and starts the application which creates the process for application.

What Image Contains? - It contains File System Snapshot which include all the dependencies and config and startup command. Whenever docker run command is executed it creates new instance from docker image file system snapshot and run the startup command configured in the image.


 
Terminology used in Containers


Popular Container Engines
Dockers

Rkt

Apache Mesos


Containers vs. VMs


Benefits of Containers
1. Saves Resources
2. Starts in Few Seconds
3. Isolate Applications not entire systems

Drawbacks of Using Virtual Machines
1. Waste Resources
2. Starts in Few Minutes
3. Isolate Systems

Both together will offer you best in class. You can run containers directly on physical machine or in a virtual machine.


Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
Part 7

No comments:

Post a Comment