docker

Windows开启Docker远程连接

2019-11-28  本文已影响0人  a_code_boy

Docker是用于创建容器化应用程序的完整开发平台。 Docker Desktop是在Windows上开始使用Docker的最佳方法。Windows版Docker桌面部分包含有关Docker桌面社区稳定版的信息。

下载&安装

开启docker的远程连接

By default, it will listen on unix:///var/run/docker.sock to allow only local connections by the root user. You could set it to 0.0.0.0:2375 or a specific host IP to give access to everybody, but that is not recommended because then it is trivial for someone to gain root access to the host where the daemon is running.

Similarly, the Docker client can use -H to connect to a custom port. The Docker client will default to connecting to unix:///var/run/docker.sock on Linux, and tcp://127.0.0.1:2376 on Windows.

docker默认的连接方式都是sock连接, 如果需要开启远程连接, 则需要指定 0.0.0.0:2375

Enable_remote_access_to_Docker_for_Windows_10-03 Enable_remote_access_to_Docker_for_Windows_10-04

到这步docker的远程连接已经开启了,但是还缺最后一步,要给防火墙添加规则,开放2375端口。

配置防火墙打开2375端口

    netsh advfirewall firewall add rule name="docker_daemon" dir=in action=allow protocol=TCP localport=2375

测试是否成功

Enable_remote_access_to_Docker_for_Windows_10-05

参考文章

https://www.portainer.io/2018/03/enable-remote-access-docker-windows-10/

https://docs.docker.com/docker-for-windows/


希望文中方法对你有用,如果有用,请动动小手点个赞👍!

祝生活愉快!

上一篇 下一篇

猜你喜欢

热点阅读