Docker 开启API:2375

Docker 开启API


Docker默认文件位置:/usr/lib/systemd/system/docker.service

cd /usr/lib/systemd/system/
vim docker.service

修改[Service]ExecStart行为下面的内容

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock --containerd=/run/containerd/containerd.sock

ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always


在原本的ExecStart中添加tcp://0.0.0.0:2375


重启docker 守护进程docker.service

systemctl daemon-reload
systemctl restart docker.service
systemctl start docker.service
发布了99 篇原创文章 · 获赞 34 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/qq_42346414/article/details/89552716