微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name

docker 报错:

Error response from daemon: Cannot restart container hello: driver Failed programming external connectivity on endpoint hello (e58d18c830689e296c0fafdd98bf56e973cee3a3fbee8a3f002d46784f69ae70): (iptables Failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 6081 -j DNAT --to-destination 172.0.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))

翻译:无法重新启动容器hello:驱动程序未能在端点hello上编程外部连接:(iptables失败:iptables–wait–t nat–A DOCKER–p tcp–d 0/0–dport 6081–j DNAT–to destination 172.18.0.2:8080!-i docker0:iptables:没有该名称的链/目标/匹配。

错误原因:

在设置linux服务器的防火墙时,重启后,原有的docker端口映射被清空,可以通过命令iptables -L可以查看iptables链,如果是空的或者上面报错的映射端口不存在,则需要重启docker服务。

解决方法

命令:

sudo systemctl restart docker

然后将每个容器重启即可,无需删除容器,无需重装docker。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐