Docker

Docker is a containerization platform that makes it easy to containerize your applications. With Docker, you can build container images, run these images to create containers, and push these containers to registries like DockerHub.

Docker Architecture:

The image below shows the Docker architecture. From it, we can see that the Docker Daemon is the main component of Docker. If the Docker Daemon is stopped, Docker will stop working entirely.

Architecture of Docker - GeeksforGeeks

Now let's try to understand the lifecycle of Docker from the image above.

There are three main components in Docker:

  • Docker Build - Builds Docker images from the Dockerfile.

  • Docker Run - Runs containers from Docker images.

  • Docker Pull - Pulls images from the Docker registry.

Docker Daemon

The Docker daemon (dockerd) listens for Docker API requests and manages Docker objects like images, containers, networks, and volumes. It can also communicate with other daemons to manage Docker services.

Docker client

The Docker client (docker) is the main tool that many Docker users use to interact with Docker. When you run commands like docker run, the client sends these commands to the Docker daemon (dockerd), which executes them. The docker command uses the Docker API. The Docker client can also communicate with multiple daemons.

Docker Desktop

Docker Desktop is an easy-to-install application for environments like Windows or Linux. It allows you to build and share containerized applications and microservices. Docker Desktop includes the Docker daemon (dockerd), the Docker client (docker), Docker Compose, Docker Content Trust, etc..

Docker registries

A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker is set to look for images on Docker Hub by default. You can also run your own private registry.

When you use the docker pull or docker run commands, the needed images are pulled from your configured registry. When you use the docker push command, your image is pushed to your configured registry.

When you use Docker, you create and use images, containers, networks, volumes, plugins, and other objects. This section provides a brief overview of some of these objects.

Dockerfile

Dockerfile is a file where you provide the step by step instructions to build your Docker Image.