iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >启动docker容器时报错iptables: No chain/target/match by that name怎么解决
  • 754
分享到

启动docker容器时报错iptables: No chain/target/match by that name怎么解决

2023-06-04 13:06:37 754人浏览 薄情痞子
摘要

这篇文章主要介绍“启动Docker容器时报错iptables: No chain/target/match by that name怎么解决”,在日常操作中,相信很多人在启动docker容器时报错iptables: No chain/tar

这篇文章主要介绍“启动Docker容器时报错iptables: No chain/target/match by that name怎么解决”,在日常操作中,相信很多人在启动docker容器时报错iptables: No chain/target/match by that name怎么解决问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”启动docker容器时报错iptables: No chain/target/match by that name怎么解决”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

具体报错:
[root@Centos72 ~]# docker run -itd -v /data/drug_app_logs:/root/drug/logs —storage-opt size=30G -p 5001:22 -p 8989:8080 drug_app:latest /usr/sbin/sshd -D
b95132b92ec379e458d2e968eb78e642d57ed9bb895052f38992d839f35704e6
docker: Error response from daemon: driver failed programming external connectivity on endpoint adoring_lamport (ea38c59bb95348ac62a87bb4e0a41436ed64d67784312b020a21c4bc273fd859):  (iptables failed: iptables —wait -t nat -A DOCKER -p tcp -d 0/0 —dport 8989 -j DNAT —to-destination 172.17.0.2:8080 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).

通过网上查找:
因为在进行原地址到目标地址转换的时候没有在docker主机的iptables规则中找到nat表规则,只有filter表规则。
在filter表上面增加nat表配置规则信息,需要说明的是docker容器的网段是172.17.0.0/16,另外需要注意filter表中也要有docker链的相关配置。

然后想起刚刚把防火墙关了,造成了docker chain的变动,因此报错。

解决方法:
 systemctl restart docker

到此,关于“启动docker容器时报错iptables: No chain/target/match by that name怎么解决”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程网网站,小编会继续努力为大家带来更多实用的文章!

--结束END--

本文标题: 启动docker容器时报错iptables: No chain/target/match by that name怎么解决

本文链接: https://www.lsjlt.com/news/238115.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作