Imagine the scenario at a firm, where the developer wants to develop an application. Thus she needs to install all the dependent software packages, libraries, modules, etc., and use them to build the desired application. After the development, it is obvious that the app needs to be tested and deployed. When the dedicated teams are about do this, it is often the case that the app fails to run smoothly on those different machines while it works perfectly fine on the machine on which it was developed. This may be due to the absence of the required software pieces, dissimilar versions or even different OS dependencies themselves. In this case, the testing and deployment teams have nothing but to go through the hassle of installing all those software packages, OS dependencies, with an eye on their versions too. This pesters anyone who wants to deal with the app, for the following reasons:
(1) the packages or the versions you wish to install may not be always available; even if they are, it is a tedious task to do it manually
(2) sometimes the OS itself needs to be transferred for the proper functioning of the app, which is heavy and hectic
Manual installation of dependencies and supporting software may consume a lot of time, due to installation issues.
A virtual machine is a virtual software environment that gives us the feel of working in a separate computer with different OS dependencies and dedicated hardware. Simply, if you have a laptop with Kali Linux OS, but you are to work with an application using Ubuntu OS, we install a virtual machine software on our machine. While installing, we dedicate some part of hardware like memory to it. Thus, this acts as if we are working on a separate machine with a whole new environment of OS and hardware resources, on our own machine.
Now, say you have 3 kinds of applications, which need Ubuntu, Debian and Fedora OS respectively. This might compel you to install 3 VMs on your machine. For this, you need to install a Hypervisor, which monitors the VMs.
According to VMware, “A hypervisor, also known as a virtual machine monitor, is a process that creates and runs virtual machines (VMs). A hypervisor allows one host computer to support multiple guest VMs by virtually sharing its resources, like memory and processing. “
All this could make the concept of virtualization turn out to be a nightmare, for the following reasons:
VMs are heavy, and each consumes a dedicated amount of resources like RAM, memory, etc., thus causing wastage of resources.
The underlying host OS isn’t used, whose resources are also wasted.
The problem of manual installation of software dependencies still persists.
The concept of containerization is designed to address these drawbacks.
A container engine, such as Docker, is to be installed on the machine. Docker is a container platform that could run multiple containers.
The docker engine which is installed on the machine, could simply handle these apps(which are containerized) without the having the need to install these VMS.
Containerization allows the developer to package an application along with its dependencies and supporting software pieces, and ship them all together as a single unit in the form of image.
This has the following advantages:
It is lightweight and fast.
Containers don’t need any dedicated hardware resources like VMs, as they are just the running instances of the images. Thus, as the resources are not fixed and are used as per their need, there is no resource wastage.
Now the app comes readily along with all the dependencies and function as expected with the minimum possible efforts. Here comes the idea of containerization into rescue.
The concept of containerization allows the developer to pack an application along with its dependencies and supporting software pieces, and ship them all together as a single unit in the form of image. If the image could be viewed as an object, the container could be viewed as the running instance of the image.
The idea of containerization is that:
the developer creates the image of the app, with all the requirements of the app described in a file. This file is like a recipe describing the required dependencies, steps to construct the image, etc.
The image thus constructed, is used by others like testing or operations team, to review the app. The teams run this image, which creates a container, inside which the app runs.
Well, Docker is a software tool.
- Removes the hassle of installing dependencies manually.
Packaging of apps along with their dependencies
Smooth functioning of applications which depend on single/multiple container(s).