Introduction to how docker provides API access

不言
Release: 2023-04-05 18:24:02
forward
2509 people have browsed it

This article brings you an introduction to the method of docker providing API access. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Docker provides api access

Environment centos

vim /etc/docker/daemon.json

Add the following configuration

{
  "hosts": [
    "tcp://0.0.0.0:2375",
    "unix:///var/run/docker.sock"
  ]
}
Copy after login

Add After deamon.json

dockerd command can start docker

At this time, requesting 127.0.0.1:2375 can be accessed normally

Using systemctl cannot start docker

systemctl restart docker
systemctl start docker
Copy after login

Unable to start docker

View the current docker configuration

systemctl cat docker | grep Exec
ExecStart=/usr/bin/dockerd -H fd://
ExecReload=/bin/kill -s HUP $MAINPID
Copy after login

Overwrite the configuration

systemctl edit docker
添加
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
Copy after login

View the configuration again

systemctl cat docker | grep Exec
ExecStart=/usr/bin/dockerd -H fd://
ExecReload=/bin/kill -s HUP $MAINPID
ExecStart=
ExecStart=/usr/bin/dockerd
Copy after login

You can use the systemctl command to start docker

This article has ended here. For more exciting content, you can pay attention to the dockerr video tutorial column on the PHP Chinese website!

The above is the detailed content of Introduction to how docker provides API access. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template