注意服务器需要防火墙开启端口,或者关闭防火墙
# 开放端口
firewall-cmd --add-port=2376/tcp --permanent
firewall-cmd --add-port=2377/tcp --permanent
firewall-cmd --add-port=7946/tcp --permanent
firewall-cmd --add-port=7946/udp --permanent
firewall-cmd --add-port=4789/udp --permanent
firewall-cmd --reload
systemctl restart docker
# 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
image.png