DOCKER — Shipping Containers to the Innovative World!!



Original Source Here

DOCKER — Shipping Containers to the Innovative World!!

Operating system-level virtualization and portable

Image Source

The Big Picture!

“The rise of innovation” in the Cloud has changed the way things used to work on the ground.

The game-changing idea of Implementing DevOps with the cloud also pointed to a set of problems like application portability, security, etc.

Let us start from the beginning……

Old IT Days

  • Only 1 application could be run per server
  • In case of new Applicaiton > oversized new servers were bought

Virtual Machines

  • The Virtual Machine (VM) was introduced
  • Hardware level virtualization[multiple guest OSes in single HostOS]
  • VM > multiple applications can run on a single server [1 application per OS]

Containers

  • OS level virtualization
  • ultra portable

In the olden days, Companies wasted a large amount of capital and resources for maintaining and setting up oversized servers which sometimes used to run as 5–10% of its potential capacity.

As a solution to this problem, a concept of “Virtualization” was introduced which presented the idea of isolating a dedicated guest OS to an application that is running over Host OS. VMs solved the problem of server capacity wastage to a greater extent as now we had a way of utilizing the spare capacity of a server in case of a new application. No more wastage of Capital and Capacity.

Well, in our world “Nothing is Perfect!” so were the VMs. Over time, a major flaw of VMs turned out to be “its nature of being tightly coupled with a dedicated OS” and Every OS uses up some CPU, RAM, and storage, plus the remaining unconsumed capacity can be efficiently used to power more applications. Along with this VM faced other challenges like High Booting time and complex portability.

Image Source

Further enhancements on OS to achieve portability and efficiency entered the game as “Containerization”.

Containerization is a technique of packaging software [Application code with all its dependencies] to a standard unit called “Containers” which enables applications to gain much-demanded portability to function over this evolving Cloud Era.

All the containers on a single host share a single OS which releases system resources such as CPU, RAM, and storage. Running with only required resources makes containers fast to start. And they are easily portable as well.

Image Source

Linux Containers

The Roots of Modern Containers were set in the Linux world. To achieve containerization Linux uses concepts like kernel namespaces, cgroups, and union filesystems. Namespaces are a feature of the Linux kernel that limits the visibility [isolates] of a set of processes whereas cgroups aka control groups are responsible for limiting and measuring the total resources for that running set of processes on a system. For Example, if app1 needs 20% resources from OS, the cgroup will measure and limit those resources for the container to be created for app1.

Finally! Docker is here…

Docker is a platform that enables us to create, package, and run our application to loosely bound containers.

Image Source

A Solution to — “Standards Conflict” …

And with every revolutionary idea endless and passionate discussions about standards and innovation should not be ignored. To keep docker and its competitors on the same page with image and container runtime format standards — a lightweight agile council to govern container standards [OCI — Open Container Initiative] was formed.”

The OCI has published two specifications

  • The image-spec
  • The runtime-spec

Coming to the Technical Stuff!! Docker Architecture

Docker helps us create isolated environments in form of containers inside which we can run our applications without any interruptions from other hardware and software entities sharing the same Host OS.

The major components of Docker Engine are Docker CLI [Docker on our machines], Rest API [interface], Docker Daemon.

Behind the scenes with Docker!

Image Source

Referring to recent docker architecture, docker has employed five elements [Let us call them warriors. After all, they are doing so much work for us] that works in a structured hierarchy to achieve the functionality docker offers.

And … Five Docker Warriors are….

  • Docker Client
  • Docker Daemon
  • containerd
  • containerd-shim
  • runc

Warriors to the TEST!!

We start by writing a Dockerfile based on our application and its specific requirements, just like a recipe to create a full application image.

A command converts the Dockerfile to an image [immutable entity divided into different layers based on Dockerfile instructions] and these images are stored in docker hub (by default).

When we execute a command say, to create a container by image name using Docker CLI. It converts the command into a RESTfull API which further communicates to Docker Daemon.

Daemon gets the image name and checks the availability of the image on the local system. In cases, if the image is not present in the local system it downloads the image from the registry (Docker Hub by default or any mentioned private registry). Now, having the image ready it makes a call to containerd using gRPC calls.

containerd acts as a supervisor here, it converts the image that was downloaded into an OCI compliance bundle. This bundle is then passed on to the containerd-shim.

containerd-shim activates runc which creates a container by interacting with namespaces and cgroups on the kernel and exit container by making containerd-shim in charge of a running container until it stops.

Image source

So, this much work is needed to make a container run on the backend.

And now Allow me to conclude with our favorite answer to the obvious question — What are Containers in Docker?

“Containers are the running instances of Application Images”

I hope you like the article. Reach me on my LinkedIn and twitter.

Recommended Articles

1. NLP — Zero to Hero with Python
2. Python Data Structures Data-types and Objects
3. Exception Handling Concepts in Python
4. Why LSTM more useful than RNN in Deep Learning?
5. Neural Networks: The Rise of Recurrent Neural Networks
6. Fully Explained Linear Regression with Python
7. Fully Explained Logistic Regression with Python
8. Differences Between concat(), merge() and join() with Python
9. Data Wrangling With Python — Part 1
10. Confusion Matrix in Machine Learning

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot



via WordPress https://ramseyelbasheer.io/2021/05/21/docker%e2%80%8a-%e2%80%8ashipping-containers-to-the-innovative-world/

Popular posts from this blog

I’m Sorry! Evernote Has A New ‘Home’ Now

Jensen Huang: Racism is one flywheel we must stop

Fully Explained DBScan Clustering Algorithm with Python