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:
- 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.
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.
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.
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.
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.
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.
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.
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.
Latest posts by Ankesh K (see all)
- Deep-Dive into Jenkins – What are all Jenkins functionalities ? - January 10, 2019
- What are different Maven Plugins and how to build a Maven project? - January 7, 2019
- What is a Maven POM File and what are different Maven Repositories? - January 3, 2019
- What is Maven and what are its benefits? - December 31, 2018
- What are the different ways to install Jenkins ? - December 27, 2018