首先,请先检查防火墙的设置
systemctl status firewalld
如果
Oct 30 18:57:14 szxc-01.novalocal firewalld[1189]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
Oct 30 18:57:14 szxc-01.novalocal firewalld[1189]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i br-a4a1843e7b30 -o br-a4a1843e7b30 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
Oct 30 18:57:14 szxc-01.novalocal firewalld[1189]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
那么你的问题应该和我类似
那么就是这个问题
dockerd启动时,参数–iptables默认为true,表示允许修改iptables路由表。要禁用该功能,可以有两个选择:设置启动参数–iptables=false
修改配置文件/etc/docker/daemon.json,设置"iptables": “false”;然后执行systemctl reload docker重新加载
vim /etc/docker/daemon.json
{
"experimental" : true,
"iptables": false
}
#重启docker
systemctl daemon-reload
systemctl restart docker
####### 3、开启或重启防火墙 #######
systemctl restart firewalld
####### 4、再次重启docker #######
systemctl restart docker