在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
Docker守护进程套接字Docker守护进程可以通过三种不同类型的套接字监听Docker Engine API请求: 默认情况下,在 如果需要远程访问Docker守护进程,则需要启用 注意:如果你使用的是HTTPS加密的套接字,请记住,仅支持 修改docker.servicevim /usr/lib/systemd/system/docker.service 在 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 重新加载配置文件和启动服务 systemctl daemon-reload && systemctl restart docker
查看 [root@izoq008ryseuupz ~]# netstat -antp | grep dockerd tcp6 0 0 :::2375 :::* LISTEN 22494/dockerd
测试接下来测试一下通过 [root@izoq008ryseuupz ~]# curl http://localhost:2375/version {"Platform":{"Name":"Docker Engine - Community"},"Components":[{"Name":"Engine","Version":"19.03.13","Details":{"ApiVersion":"1.40","Arch":"amd64","BuildTime":"2020-09-16T17:02:21.000000000+00:00","Experimental":"false","GitCommit":"4484c46d9d","GoVersion":"go1.13.15","KernelVersion":"3.10.0-514.26.2.el7.x86_64","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"1.3.7","Details":{"GitCommit":"8fba4e9a7d01810a393d5d25a3621dc101981175"}},{"Name":"runc","Version":"1.0.0-rc10","Details":{"GitCommit":"dc9208a3303feef5b3839f4323d9beb36df0a9dd"}},{"Name":"docker-init","Version":"0.18.0","Details":{"GitCommit":"fec3683"}}],"Version":"19.03.13","ApiVersion":"1.40","MinAPIVersion":"1.12","GitCommit":"4484c46d9d","GoVersion":"go1.13.15","Os":"linux","Arch":"amd64","KernelVersion":"3.10.0-514.26.2.el7.x86_64","BuildTime":"2020-09-16T17:02:21.000000000+00:00"}
很显然可以通过 再来测试一下远程通过主机IP能否使用Docker Engine API,请求
IDEA也是可以进行远程连接的。 可能的问题 如果远程访问不了,可能需要设置一下服务器的防火墙,应该是 到此这篇关于Docker开启远程访问的实现方式的文章就介绍到这了,更多相关Docker 远程访问内容请搜索极客世界以前的文章或继续浏览下面的相关文章希望大家以后多多支持极客世界! |
请发表评论