What Is Docker And How It Works?

Freddychris A
YavarTechWorks
Published in
3 min readSep 22, 2022

--

What is docker?

Docker is a tool which is used to automate the deployment applications in a lightweight container so the application can work efficiently in different environments. Its is important to note that the container is actually a software package that consists of all the dependencies required to run the application. So multiple containers can run on the same hardware the containers are maintained in isolated environments they are highly productive and they are quick.

Similarly for computers docker provides suitable frameworks for different applications. Since every application has a framework with a suitable version, This space also can be utilised for a new software application, alone with its required framework As a result, Docker makes more efficient use of system resources.

How does Docker work?

Docker Engine or Docker is the base engine installed on your host machine to build and run containers using Docker components and services.

It uses a client-server architecture
Docker Client and Server communicate using Rest API
Docker Client is a service which runs a command. The Command is translated using REST API and is sent to the docker deamon (server).
Then, Docker Daemon checks the client request and interacts with the operating system in orf=der to create or manage containers


Components of Docker :
Docker Client and server:-

1) Docker Client is accessed from the terminal and a Docker Host Runs the Docker Daemon and Registry
2) A User can build Docker Images and run docker containers by passing commands from the docker client to docker server.

Docker Image :-

1) Docker image is a template with instructions, which is used for creating Docker Containers.
2) A Docker Image is build using a file called Docker File.
3) Docker image is stored in a Docker Hub or in a repository (like registry.hug.Docker.com).

Syntax to create a Docker Container using Docker Image:

Docker container create [OPTIONS] IMAGE [COMMAND][ARG…]

Docker Container is a standaline executable software package which includes applications and their dependencies.

Numerous Docker Containers run on the same infrastructure and share operating system (OS) with its other containers.

Here, each application runs in isolation

Docker Registry is an open source server-side service used for hosting and distributing images.

Docker also has its own default registry called Docker Hub.

Here, images can be stored in either public or private repositories.

Pull and Push are the commands used by users in orde to interact with a docker registry.

Docker pull <image>:<tag>: pulls an image from DTR
Docker push <image>:<tag>:pushes an image to DTR

Why docker?

Developer with actually build their code and then they send it to the tester but then the code wouldn't work on their system.

The code doesn't work on the other system due to the difference in computer environments
So, what could be the solution to this?
→ Virtual machine can be the solution
→ Docker can be a better solution

In Docker the guest OS for each container has been eliminated docker is more light weight but provides the same functionality as a virtual machine

--

--