驽马十驾 驽马十驾

驽马十驾,功在不舍

目录
Docker 启动容器报错:iptables: No chain/target/match by that name.
/  

Docker 启动容器报错:iptables: No chain/target/match by that name.

今天通过Docker重启应用的时候,发现无法启动,直接就提示错误:

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

关键信息是

iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8084 -j DNAT --to-destination 
172.17.0.2:8084 ! -i docker0: iptables: No chain/target/match by that name.

遇到这个问题很简单,重启下docker服务(不是容器,是docker自身这个服务)

service docker restart
不积跬步,无以至千里。不积小流,无以成江海。