51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

Docker开启2375端口,提供外部访问Docker

1、编辑docker文件:/usr/lib/systemd/system/docker.service

[root@localhost ~]# vim /usr/lib/systemd/system/docker.service
文章源自小柒网-https://www.yangxingzhen.cn/7721.html

修改ExecStart行为下面内容文章源自小柒网-https://www.yangxingzhen.cn/7721.html

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375

或者
文章源自小柒网-https://www.yangxingzhen.cn/7721.html

[root@localhost ~]# sed -i 's#/usr/bin/dockerd#& -H tcp://0.0.0.0:2375#' /usr/lib/systemd/system/docker.service
文章源自小柒网-https://www.yangxingzhen.cn/7721.html

文章源自小柒网-https://www.yangxingzhen.cn/7721.html

2、重新加载docker配置
文章源自小柒网-https://www.yangxingzhen.cn/7721.html

[root@localhost ~]# systemctl daemon-reload
文章源自小柒网-https://www.yangxingzhen.cn/7721.html

[root@localhost ~]# systemctl restart docker文章源自小柒网-https://www.yangxingzhen.cn/7721.html

3、查询端口文章源自小柒网-https://www.yangxingzhen.cn/7721.html

[root@localhost ~]# netstat -lntup文章源自小柒网-https://www.yangxingzhen.cn/7721.html

历史上的今天

12 月
16

赞(3)
未经允许不得转载:工具盒子 » Docker开启2375端口,提供外部访问Docker