Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of interaction between Docker command line and daemon

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In order to ensure readability, this paper adopts free translation rather than literal translation. In addition, the copyright of this article belongs to the original author, and the translation is for learning only.

Docker is not a single application, it is composed of multiple components. This blog will introduce the Docker daemon (daemon) and Docker command line (CLI). In fact, when we're talking about installing or using Docker, we're actually talking about Docker daemons and command lines.

Docker architecture diagram

Explain the elements in the figure above:

The Docker daemon (docker daemon) is a service running on your operating system. Currently, it can only run on Linux because it relies on some Linux kernel features (such as Cgroup and Namespace). However, there are some special ways for Docker to run on MacOS and Windows (running in the Linux virtual machine).

The Docker daemon provides REST API. Many tools (Docker command line, Docker Compose, etc.) can interact with Docker daemons through REST API, such as creating containers, building images, and so on.

The Docker command line (docker CLI) is the primary tool for interacting with the Docker daemon.

Docker is the architecture of Cramp S

Docker is the Client/Server architecture. The Docker daemon is the server, and the Docker command line is one of the many clients. In fact, there are many third-party Docker clients.

For a variety of popular programming languages, they all have corresponding Docker clients. If you are interested, you can also develop one that uses REST API to interact with the Docker daemon.

Through the client, you can manage various elements of Docker, including mirrors, containers, networks, and data volumes. If you are interested in Docker, you might as well take a look at Dive Into Docker course.

How does the Docker command line interact with the daemon?

Understand the image above from left to right:

On the far left is the Docker client, the Docker command line. We can run various Docker commands, such as building an docker build, downloading an docker pull, and running a container (docker run). The Docker command line can be installed on a variety of operating systems, such as Windows,MacOS or Linux servers.

In the middle is the Docker host on which the Docker daemon is running. The Docker command line can easily connect to a remote Docker host (given IP and port). When "running" Docker on MacOS and Windows, the Docker daemon is actually running in the Linux virtual machine. The key point here is that the Docker daemon and the command line can run on different hosts.

On the far right is the Docker warehouse, which is also part of the Docker ecosystem. It is the place where we download, upload, store and share Docker images. The details of the Docker repository are not relevant to this article, so I will not repeat them.

The translator's note: Docker is a typical C daemon S architecture, and its daemon (daemon) interacts with the command line (CLI) through REST API.

Original: Understanding how the Docker Daemon and Docker CLI Work Together

Translator: Fundebug

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report