Docker architecture

Docker is based on a client-server architecture. Docker has three main components to its architecture:

  • Docker client
  • Docker daemon
  • Docker registries

Let's see the following diagram of the Docker architecture:

  • Docker client: It is an interface (CLI) to run the Docker commands, such as build, run, and stop. The Docker client interacts with the Docker daemon server. You can also connect the Docker client with the remote Docker daemon. It uses REST APIs to build communication between the Docker client and the Docker daemon server using Unix sockets or a network interface.
  • Docker daemon: It is a process running in the background. It can listen for all requests of the Docker API and it can manage Docker objects, such as images, containers, networks, and volumes.
  • Docker registries: This component is used to store Docker images either publicly or privately. Docker Hub and Docker Cloud are examples of the public Docker registry; anyone can use this type of registry. Docker Datacenter (DDC) and Docker Trusted Registry (DTR) are examples of private Docker registries.
  • Docker Host: It is the complete Docker environment required to run your application. Docker Host provides Docker images, containers, and the Docker daemon server.
  • Docker image: It is an immutable Docker object and it cannot be changed once created. Docker images are one of the key components of the Docker architecture. It contains all required resources for running your application, such as operating system and libraries. It can be run from any Docker platform after creation.

For example, in a Spring Boot microservice, the accumulated package of operating systems, such as Ubuntu, Alpine, JRE, and the Spring Boot application JAR file, is a Docker image. Let's see the following diagram of the Docker image:

As you can see, it contains Spring Boot application JAR, Java Runtime (JRE), and operating systems, such as Ubuntu. It is a runnable artifact and can be run on any Docker machine.

To see the list of images that are available locally, use the docker images command. Let's see the output of this command:

The preceding screenshot displays a list of Docker images containing information such as REPOSITORY, TAG, Image ID, CREATED time, and SIZE. REPOSITORY refers to the local repository name for a Docker image. TAG means the version of a Docker image and IMAGE ID represents a unique identifier for a Docker image. Let's see another component of the Docker architecture.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.55.18