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

小柒助手 Docker评论65.1K2字数 411阅读1分22秒阅读模式

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
Wechat
微信扫一扫,加我!
weinxin
我的微信
微信公众号
微信扫一扫,关注我!
weinxin
我的公众号
Docker最后更新:2022-11-25
小柒助手
  • 本文由 小柒助手 发表于 2020年12月16日11:12:47
  • 声明:本站所有文章,如无特殊说明或标注,本站文章均为原创。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。转载请务必保留本文链接:https://www.yangxingzhen.cn/7721.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖动滑块以完成验证