Cannot start container web: iptables failed: iptables -t nat -A DOCKER -p tcp -d 0/0 --dport 32797

docker 启动 web 示例报错如下:

Error response from daemon: Cannot start container web: iptables failed: iptables -t nat -A DOCKER -p tcp -d 0/0 --dport 32797 -j DNAT --to-destination 172.17.0.30:5000 ! -i docker0: iptables: No chain/target/match by that name.
  • 1

网上查找发现,可能是网络问题造成
首先先验证docker容器内部网络是否能ping通宿主机
如果能ping通,即可通过重建docker0网络恢复
先停掉宿主机上运行的docker容器,然后执行以下命令

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

pkill docker 
iptables -t nat -F 
ifconfig docker0 down 
brctl delbr docker0 
docker -d 
service docker restart

猜你喜欢

转载自blog.csdn.net/qq_37674858/article/details/80116777