【Docker】启动container的时候出现iptables: No chain/target/match by that name
文章目录
[隐藏]
- 问题
- 原因(猜测)
- 处理
- 另一个方法
问题
Error response from daemon: driver failed programming external connectivity on endpoint jenkins (a8ea15bf9b3dbed599d059d638f79f9dd5e875556c39bfb41e6563d3feedb81b): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 50000 -j DNAT --to-destination 172.18.0.6:50000 ! -i br-031aa3930383: iptables: No chain/target/match by that name.
光看这个报错: iptables: No chain/target/match by that name
,就能够看出是跟iptables有关
原因(猜测)
如果再启动docker service的时候网关是关闭的,那么docker管理网络的时候就不会操作网管的配置(chain docker),然后网关重新启动了,导致docker network无法对新container进行网络配置,也就是没有网管的操作权限,做重启处理
处理
service docker restart 或 systemctl docker restart
使用的centos7服务器,在部署docker的过程中,因端口问题有启停firewalld服务,在centos7里使用firewalld代替了iptables。在启动firewalld之后,iptables还会被使用,属于引用的关系。所以在docker run的时候,iptables list里没有docker chain,重启docker engine服务后会被加入到iptables list里面。(有必要深入研究一下docker network)
另一个方法
关闭网关(不建议)
systemctl stop firewalld systemctl stop iptables
原文出处:csdn -> https://blog.csdn.net/u013948858/article/details/83115388
本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如果侵犯你的利益,请发送邮箱到 [email protected],我们会很快的为您处理。
超哥软件库 » 【Docker】启动container的时候出现iptables: No chain/target/match by that name
超哥软件库 » 【Docker】启动container的时候出现iptables: No chain/target/match by that name