Containerization Explained

We might think the Container is easy to understand and pretty straight-forward to implement. Generally, we misuse the container terminologies and use different terms to symbolize different functionalities but there are important conceptual differences.

Actually, the Container is very vast and larger than just Docker. In our last blog, we went through the Basics of Containerization. If you want to go through the basics, click on the hyperlink and come back here. Let’s first understand how containers work.

 

How Containers do work?

  • Containers keep all the components to run the desired software. These components include files, dependencies, micro-services and environment variables that allow a program to be executable.
  • These containers run on the top of Container engine which is on the top of the Operating system.
  • Container Image files are a complete executable version of an application or the service.
  • Docker images are built of multiple layers which starts with a base image. Proceeding with it are the layers of software and dependencies.
  • Each container has their specific container layer, so the images under it can be saved and reused again and again.
  • The image specification contains the information needed to launch the application or service in the container.
  • Items usually bundled into a container include:
    • Application
    • Dependencies
    • Libraries
    • Binaries
    • Configuration files

It is very easy to start your container service. The installation is pretty straight with few commands and you can start using the commands after that. In this blog, we will go through some of the container terminologies and their functionalities.

 

Container Image

A Container Image is a file which is pulled from the Registry Server and used locally as a mount point while starting the containers. We generally use container images like Docker, RKT (CoreOS Rocket) or LXD (Linux Container).

Each of these services uses Container Images in different ways. LXD pulls a single image while Docker and RKT use OCI (Open Container Initiative) based images which can be made up of multiple layers.

 

Container Image Format

Each Container Engine has its own Container Image Format. Some of them are made up of a single layer as LXD while others like RKT and Docker may have in multiple layers.

Nowadays, the majority of the famous tools has moved to a format called OCI (Open Container Initiative). This format comprises of both of the image and the metadata in the Container Image.

 

Container Engine

A Container Engine is a software that accepts user requests, including command line options, pull-push images from the user to run the container. There are many containers like Docker, RKT, LXD, etc. Also, cloud providers have their own built-in container engine.

Having an industry standard Container Image Format allows interoperability between different Container platforms. Container Engine handles user input and even the inputs from the API. It also helps to pull Container Images from the registry.

 

 

Container

A container is a runtime installation of a Container Image. It is created on the top of the Base machine. There can be multiple containers (Container Host) on a single Base VM.

Generally, Containers are of two types, Application Container, and System Container. It is very lightweight and provisions very fast.

 

Container Host

The Container Host is a system that runs the containerization process. This could be a bare-metal running on your data center, instance running in a public cloud or Linux OS running in a Virtual Machine.

 

Registry Server

 

A Registry Server is a file server that is used to store Docker Repositories. The functions like docker push and docker pull, pull and push the files into a repository in this Registry server.

When a docker daemon does not find the image locally in the server, it downloads it from Registry Server.

 

Repository

Docker repository is the collection of different Docker images with the same name but different tags or versions. For Ex: we have used Ubuntu images in our Dockerfile multiple times but we mention 14.04, 16.04 or 18.04 as a tag to download the version of Ubuntu we want.

Conclusion

Containers are ­quite easy to understand but when creating an architecture for the production environment, it moves the complexity to a new level. The commands are quite easy to use but when the time comes for discussing architecture, it’s important to understand each and every terminology used in Containerization.

We have taken Docker as a tool in this category and created a learning project, to access it, click here.

Stay tuned @ linuxnix.com.

 

The following two tabs change content below.
Hello, my name is Ankesh and I work as a Sr. DevOps Engineer in an IT firm where I have hands-on experience in supporting and automating deployments in the cloud, leveraging configuration management and DevOps process. I like to keep myself always in the learning path and love to share knowledge with others. One of my other interests is Graphics Designing and my hobbies are Cooking and Playing Cricket.