Error response from daemon: driver failed programming external connectivity on endpoint * (9a1988ab11cce151bf53cac4a565656d3d96829867d11b1166fb6efd19cbbcad): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 12345 -j DNAT --to-destination 172.17.0.6:80 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))

对于重启Docker中的容器Iptables报错,报错内容为以上格式的解决方案,经过搜索后找到个比较简单的解决办法,不用重新设置Firewalld和Iptables。

具体操作如下:

service docker restart

systemctl docker restart

只需要重启Docker一下在启动对应的容器业务就可以解决啦!

重启后可以查看Iptables链
输入命令

iptables -L
你可能会看到如下结果
Chain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 172.17.0.6 tcp dpt:http

不重启Docker的解决方案,此方案未经尝试,当前只做思路记录,仅供参考

编辑Iptables

vim /etc/sysconfig/iptables

iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 12345 -j DNAT --to-destination 172.17.0.6:80
将这条删除后尝试重启对应容器业务,实际上在我VPS上面Iptables内容并没有这一条。。。 如果你的有可以考虑编辑掉这条的解决方案