美文网首页
Ubuntu Docker开启2375端口,支持远程访问

Ubuntu Docker开启2375端口,支持远程访问

作者: AC编程 | 来源:发表于2022-01-26 23:07 被阅读0次

一、修改docker.service文件

1、编辑docker文件

vi /lib/systemd/system/docker.service

2、ExecStart属性添加参数

-H tcp://0.0.0.0:2375
ExecStart属性添加参数

二、重启

1、加载docker守护线程

systemctl daemon-reload

2、重启docker

systemctl restart docker

三、测试是否开启成功

curl http://localhost:2375/version
root@iZwz9f4eh9lmah6qiq41zvZ:~# curl http://localhost:2375/version
{"Platform":{"Name":"Docker Engine - Community"},"Components":[{"Name":"Engine","Version":"20.10.12","Details":{"ApiVersion":"1.41","Arch":"amd64","BuildTime":"2021-12-13T11:43:36.000000000+00:00","Experimental":"false","GitCommit":"459d0df","GoVersion":"go1.16.12","KernelVersion":"4.15.0-166-generic","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"1.4.12","Details":{"GitCommit":"7b11cfaabd73bb80907dd23182b9347b4245eb5d"}},{"Name":"runc","Version":"1.0.2","Details":{"GitCommit":"v1.0.2-0-g52b36a2"}},{"Name":"docker-init","Version":"0.19.0","Details":{"GitCommit":"de40ad0"}}],"Version":"20.10.12","ApiVersion":"1.41","MinAPIVersion":"1.12","GitCommit":"459d0df","GoVersion":"go1.16.12","Os":"linux","Arch":"amd64","KernelVersion":"4.15.0-166-generic","BuildTime":"2021-12-13T11:43:36.000000000+00:00"}
root@iZwz9f4eh9lmah6qiq41zvZ:~# 

相关文章

网友评论

      本文标题:Ubuntu Docker开启2375端口,支持远程访问

      本文链接:https://www.haomeiwen.com/subject/jysohrtx.html