What is a host in docker
In docker, the host machine is also "Docker_Host", which is one of the overall architecture of Docker. It can be a physical machine or a virtual machine. A docker service is running on the host machine, using "docker daemon" "Can realize the life cycle management of docker objects.
The operating environment of this tutorial: linux7.3 system, docker-1.13.1 version, Dell G3 computer.
What is a host in docker
Docker can be imagined to a certain extent as a more lightweight computer with its own private operating system, network, and independent memory. And it provides strong enough packaging capabilities. Similar to the container analogy, we have packaged everything in one space. The host is the ship that pulls the box, and a packaged container is an independent existence. The underground ship can be changed at will, while the contents of the box remain unchanged. With this capability, Docker can run a software without tedious configuration of the host when installing the service. In the past, when we developed a java program, the host must provide a jre environment. If there is no such environment, unfortunately the program cannot be executed. With the container, this is easy. Pull an image, run it, and end it.
The overall architecture of Docker is divided into three parts, Clint, Docker_Host, Registey:
Clinet: Same as mentioned above, it is the command line operation interface. By using the API interface, communication with the Doceker daemon is completed.
Docker_Host: Docker's host machine can be a physical machine or a virtual machine. A docker service runs on it. We use docker daemon to realize the life cycle management of docker objects.
Registey: docker registry strictly speaking does not belong to docker. It is another warehouse service and is the storage center for docker images. The official warehouse of docker is docker hub. We create it ourselves. For the convenience of the development team, we will maintain a warehouse, which we generally use harbor to implement.
There is a core in Docekr called Docker Engine. What is this? Just think of it simply as a C/S service, or more generally, it's a software. The overall architecture diagram is as follows:
Here is a brief introduction to some of its core concepts. The content not mentioned is too complicated and will be discussed later. Detailed description:
Server: The core part of the entire structure, the real executor of the command, inside which lives the docker daemon, which is simply a guardian docker daemon, running for a long time, resident in the memory , responsible for creating and managing dockers objects, such as images, containers, networks and volumes. You can find a process called dockerd in Linux.
Rest Api: Just like its name, it is an interface provided to the outside world. These interfaces can be used to call and execute the docker service and complete communication with the daemon.
Client: The outermost command line interface (CLI).
Recommended learning: "docker video tutorial"
The above is the detailed content of What is a host in docker. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The steps to update a Docker image are as follows: Pull the latest image tag New image Delete the old image for a specific tag (optional) Restart the container (if needed)

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

Steps to create a Docker image: Write a Dockerfile that contains the build instructions. Build the image in the terminal, using the docker build command. Tag the image and assign names and tags using the docker tag command.

Troubleshooting steps for failed Docker image build: Check Dockerfile syntax and dependency version. Check if the build context contains the required source code and dependencies. View the build log for error details. Use the --target option to build a hierarchical phase to identify failure points. Make sure to use the latest version of Docker engine. Build the image with --t [image-name]:debug mode to debug the problem. Check disk space and make sure it is sufficient. Disable SELinux to prevent interference with the build process. Ask community platforms for help, provide Dockerfiles and build log descriptions for more specific suggestions.

To save the image in Docker, you can use the docker commit command to create a new image, containing the current state of the specified container, syntax: docker commit [Options] Container ID Image name. To save the image to the repository, you can use the docker push command, syntax: docker push image name [: tag]. To import saved images, you can use the docker pull command, syntax: docker pull image name [: tag].

Four ways to exit Docker container: Use Ctrl D in the container terminal Enter exit command in the container terminal Use docker stop <container_name> Command Use docker kill <container_name> command in the host terminal (force exit)

Methods for copying files to external hosts in Docker: Use the docker cp command: Execute docker cp [Options] <Container Path> <Host Path>. Using data volumes: Create a directory on the host, and use the -v parameter to mount the directory into the container when creating the container to achieve bidirectional file synchronization.

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).
