Docker iptables failed: iptables -t nat -A DOCKER -p tcp

Dokcer网络问题

因为操作或修该过iptables导致docker容器出现如下错误:

[root@mysqlserver ~]# docker restart cvnavi-centos-tomcat-20170814 
Error response from daemon: Cannot restart container cvnavi-centos-tomcat-20170814: iptables failed: iptables -t nat -A DOCKER -p tcp -d 0/0 --dport 18091 -j DNAT --to-destination 172.17.0.3:8080 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)
Error: failed to restart containers: [cvnavi-centos-tomcat-20170814]

修复时先停掉宿主机上运行的docker容器,然后执行以下命令:

pkill docker 

iptables -t nat -F 

ifconfig docker0 down 

brctl delbr docker0 

docker -d 

systmctl restart docker
重启docker问题即可解决。
 

Docker之间通信

最简单的方法,关闭防火墙(只建议用于开发环境)

 systemctl stop firewalld

转载于:https://www.cnblogs.com/boonya/p/7366450.html

你可能感兴趣的:(Docker iptables failed: iptables -t nat -A DOCKER -p tcp)