Docker Series Part 1

Mrigank Singh
CodeX
3 min readApr 21, 2022

--

Why use docker?

In childhood, every one of us has installed games and many software on our PC and then has faced some dependency issues like I used to meet a lot that DLL file is missing and many other problems. Then we troubleshoot this issue to rerun the program installation and, again, an error. After such 10 to 20 cycles and spending almost 1 to 2 hrs in the installation process, we could finally enjoy it. Docker is trying to solve this issue in short. Docker makes it early to install and run software without worrying about the setup or dependencies.

What is Docker?

Docker is an ecosystem around creating and running containers. The Docker ecosystem contains Docker CLI, Docker server, client and hub, etc.

Docker Ecosystem

To understand the concept of the Docker container, we have first to understand the image. When we install an operating system, we also download an image file of the operating system, which we then make bootable by using the software. That software installs all the dependencies in that bootable device. In the same way, the Docker image contains all the required dependencies and setup required to install a particular software. The containers, in simple terms, are running instances of Docker images.

Installing Docker on Ubuntu

Docker in our local machine comes mainly with two essential parts of the Docker ecosystem: Docker CLI and Docker Server. When we issue commands to the Docker with the help of our Ubuntu Command-Line, that is the Docker client or CLI issuing the commands, and then comes the Docker server, which plays a central role as the Docker server is responsible for creating images, managing servers, uploading images and running containers, etc.

Running First Image

So let's see what is happening in this step more clearly:

  1. Docket Client connects to the Docker server, which locally looks for the image “hello-world.”
  2. When the image is not found locally, the Docker server connects to the Docker Hub, a repository of publicly hosted images, and finds and downloads the hello-world image.
  3. The image is fetched and stored in the image cache locally, and then a container of the image is created, which displays the output “Hello from Docker!”.

What is Container?

A container is a set of resources aligned to run a particular process or group of processes. A portion of RAM, Network, CPU, Hard Drive, etc., is aligned to a container.

Image

The docker uses namespaces and control groups to create this separate space for RAM, CPU etc for every process. The concept of namespaces and control groups are inherent to linux OS. So how does docker is running on Windows or MacOS OS. Actually they uses linux virtual machine behind the scenes.

Click here to access Docker Part 2 Series.

--

--