[root@docker ~]# docker run -itd --name wordpress -p 88:80 wordpress:v1
b77482f8075042e9cc6723d6922a1211c37d99339678a00cc040396b23d40ef0
docker: Error response from daemon: driver failed programming external connectivity on endpoint wordpress (77cb6b1ea5387ac97b1b90178b2ccda831aa9713e0e9a83be057083fed66fc69):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 88 -j DNAT --to-destination 172.17.0.2:80 ! -i docker0: iptables: No chain/target/match by that name.

 (exit status 1)).


解决方法:重建docker0网络恢复

pkill docker

iptables-t nat -F

ifconfig docker0 down

brctl delbr docker0

docker-d

service docker restart


我为什么会出现这样的错误呢 ,因为我在docker运行的时候,执行了systemctl stop firewalld,关闭防火墙可能会清空docker规则。


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐