An error was reported when starting the container: iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 1217 -j DNAT --to-de

cause of issue:

An error is reported when starting the container with the tomct image:

[root@localhost Tomcat]# docker run -d --name tomcat2 -p 1217:8080 tomcat:centos
0556dfeca0ba77452a7d93546cf65b8b96d3e294916dab798438caedd1efb8dc
docker: Error response from daemon: driver failed programming external connectivity on endpoint tomcat2 (a1948113741590843b4c4439833f6fcfd555bc71c9fab97d51e4b55d2e4e60ab):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 1217 -j DNAT --to-destination 172.17.0.5:8080 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)).

Solution:

1.重启docker服务

[root@localhost Tomcat]# systemctl restart docker.service

2.删掉不完整容器,利用该镜像重新启动一个容器

[root@localhost Tomcat]# docker run -d --name tomcat2 -p 1217:8080 tomcat:centos

Guess you like

Origin blog.csdn.net/chengu04/article/details/108723815