1.编辑docker.service
vi /usr/lib/systemd/system/docker.service
2.修改ExecStart 如下
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
3.加载docker守护线程
systemctl daemon-reload
4.重启docker
systemctl restart docker
5.开启端口
firewall-cmd --zone=public --add-port=2375/tcp --permanent
6.立即生效
firewall-cmd --reload