Docker远程连接配置

1、修改docker.service启动信息

 2、修改daemon.json

 3、重载、重启

[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# service docker restart

4、内部连接测试

[root@localhost ~]# curl http://192.168.220.66:2375/verion

或者

docker -H 192.168.220.66:2375 ps

5、如果Centos是在虚拟机中,外部主机需要连接,则需要关闭Centos的防火墙

sudo systemctl stop firewalld 临时关闭

sudo systemctl disable firewalld ,然后reboot 永久关闭

sudo systemctl status  firewalld 查看防火墙状态。

6、VS Code 连接Docker

猜你喜欢

转载自www.cnblogs.com/lxmzq/p/12474489.html