您的位置:首页 > 运维架构 > Docker

docker容器iptables failed: iptables --wait -t nat -A DOCKER&n

2018-03-30 18:22 405 查看
今天tomcat的docker容器挂了,只要是带命令-p映射端口就起不来并且报错:Error response from daemon: Cannot start container eb9d501f56bc142d9bf75ddfc7ad88383b7388ca6a5959309af2165f1fff6292: iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8081 -j DNAT --to-destination 172.17.0.164:8080 ! -i docker0: iptables: No chain/target/match by that name. (exit status 1)
网上查找发现,可能是网络问题造成首先先验证docker容器内部网络是否能ping通宿主机如果能ping通,即可通过重建docker0网络恢复先停掉宿主机上运行的docker容器,然后执行以下命令在宿主机执行:pkill docker 
iptables -t nat -F 
ifconfig docker0 down 
brctl delbr docker0 
docker -d 
systmctl restart docker重启docker服务
问题即可解决。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: