What is docker
Hello solvers…..
I have discussed here all about the docker and containerization concepts in this blog. I’m not going to talk about hands on practical things in here, but I’m talking about all the basic concept and explain how it’s actually work in real world.
Why we need docker and containerization
Actually docker is an eco-system that create and run containers. So first we should understand why we need this.
When we develop a software or web application there are multiple teams like development team, testing team, operational team. Developers are used several technologies and frameworks to develop a software. So these frameworks and technologies use some libraries, dependencies and some OS level features.
Because of that you need to download all the libraries and dependencies from the internet. So after develop the application then you need to ship to the testing team.
Sometimes in testing team’s machines will not work the application so it’s not the application’s issue. Developers will give all the dependencies list to the testing team that application want. But sometimes the versions of the libraries and dependencies might be difference in developers and testers. Because of that application might be not work.
Sometimes developers use some extra dependencies to their new application that dependencies you used previous projects, but those extra dependencies will not have in tester machine. This is also a reason for not work the application in tester machine that developer developed.
To solve that developers should give all the things (dependencies, libraries) to the tester. Is it possible? But some dependencies and libraries are dependent on OS. Because of that we need proper solution to solve this problem.
There is a solution with virtualization concept. So to solve above problems first came hypervisor with virtualization concept. We can run multiple OSs on the hypervisor.
We can ship our system with all the things (dependencies, libraries and OS) to the testing team. we can ship all the things like that very easily, so we called as an image that we shipped to the tester. Because of that there will not happen any dependence problems, OS problem in testing and operational team.
But in this hypervisor technology works on own hardware and a OS. Because of that there are some disadvantages also such as that is very costly, we need to pay lot to the licenses.
……………………………………………………………………………………..
After container concept came to overcome these disadvantages. Containers don’t want to install individual OSs like hypervisor. There is a same OS kernel. Docker has build on this containerization concept.
We can run multiple containers on the docker. So each container, we can run own applications. And also in each container have all the dependencies, libraries that application wants. A container, that we can easily share and moved around and also deployment more efficient.
We can download any docker image that our application wants. That’s mean let’s say if we want Nodejs dependencies and libraries to our application, then we can download those things as a docker images to our local machine. In DockerHub, there are thousands of libraries as container images.
……………………………………………………………………………………….
What is a docker image
A docker image is unchangeable(immutable) file that contains all the dependencies, libraries, configurations needed for an application to run. An image has a feature that is read-only, because of that sometimes we called as snapshot. These images can run on a container.
A docker image has several layers. When we download a image, download as layer by layers to our local machine.
What is a container
A Docker container image is a lightweight, standalone, executable package of software that has everything you need to run an application — code, runtime, system tools, system libraries, and settings.
Actually a container looks like a stack that build with various container images. At the bottom of this stack has Linux base image, and application image is run on the top of the stack.
Docker architecture
In this picture you can see whole docker architecture and how it works. Developers can pull docker images from docker registry (DockerHub) and also they can run and build. In the middle you can see a server, all the containers and images are there that application want.
The Docker daemon is a service that runs on your host operating system. It currently only runs on Linux because it depends on a number of Linux kernel features, but there are a few ways to run Docker on MacOS and Windows too.
……………………………………..End……………………………………………
I think you can get better understand about docker, how it works, what are the importance of it. I’m not talked about any practical things here, because I want to share how it’s really work.
!!……..