Docker端口映射或启动容器时报错Error response from daemon: driver failed programming external connectivity on ...

Docker端口映射或启动容器时报错Error response from daemon: driver failed programming external connectivity on ...

今天我在启动docker的时候遇到了一个错误

docker run -p 9000:9000 --name prtainer2 --restart=always  -v /var/run/docker.sock:/var/run/docker.sock -d portainer/portainer

错误如下

docker: Error response from daemon: driver failed programming external connectivity on endpoint prtainer2 (58c5e2140a7a47d1bf0af6df413bbbf8ae1e8baf38f10e7628a1185151c18526):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9000 -j DNAT --to-destination 172.17.0.7:9000 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)).

Docker端口映射或启动容器时报错Error response from daemon: driver failed programming external connectivity on ..._第1张图片

错误原因

docker服务启动时定义的自定义链DOCKER由于某种原因被清掉
重启docker服务及可重新生成自定义链DOCKER

其实原因有很多,可能是你误操作或者是重启了linux内核的守护进程导致的

解决方案

重启docker服务后再启动容器
systemctl restart docker

 

 

你可能感兴趣的:(Docker)