docker启动时报错Error response from daemon: driver failed programming external connectivity on endpoint *
Posted djlsunshine
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker启动时报错Error response from daemon: driver failed programming external connectivity on endpoint *相关的知识,希望对你有一定的参考价值。
公司服务器由于断电重启,部署在docker服务上的一些web服务需要重新开启容器,
[[email protected] ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d77c2c6b3650 chandao:latest "/app/docker-entrypo…" 7 days ago Up About an hour 0.0.0.0:7075->80/tcp chandao
当重新开启容器的时候,web服务页面无法访问
[[email protected] ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 18807008623c centos:latest "/bin/bash" 3 days ago Exited (255) About an hour ago heuristic_aryabhata d77c2c6b3650 chandao:latest "/app/docker-entrypo…" 7 days ago Up About an hour 0.0.0.0:7075 ->80/tcp chandao 12d299f61e0b djltomcat:latest "/root/run.sh" 2 weeks ago Exited (255) About an hour ago 0.0.0.0:7074 ->8080/tcp kjxy [[email protected] ~]# docker start kjxy kjxy [[email protected] ~]# [[email protected] ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d77c2c6b3650 chandao:latest "/app/docker-entrypo…" 7 days ago Up About an hour 0.0.0.0:7075->80/tcp chandao 12d299f61e0b djltomcat:latest "/root/run.sh" 2 weeks ago Up 27 seconds 0.0.0.0:7074->8080/tcp kjxy [[email protected] ~]# systemctl stop firewalld [[email protected] ~]# [[email protected] ~]# systemctl is-active firewalld inactive
于是重新启动了一下容器,报如下错误
[[email protected] ~]# docker stop kjxy kjxy [[email protected] ~]# [[email protected] ~]# docker start kjxy Error response from daemon: driver failed programming external connectivity on endpoint kjxy (d347e043e31906b2bcb2733437cc52fd96fc653c3fcca18b664f65940da9db79): (ip tables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 7074 -j DNAT --to-destination 172.17.0.6:8080 ! -i docker0: iptables: No chain/target/match by that name. (exit status 1)) Error: failed to start containers: kjxy [[email protected] ~]#
查看容器详细信息
[[email protected] ~]# docker inspect kjxy [ { "Id": "12d299f61e0bccd29d35bffe5e98ff6abba934673c457e50246d1a857ebe4374", "Created": "2019-03-05T05:22:35.219042191Z", "Path": "/root/run.sh", "Args": [], "State": { "Status": "exited", "Running": false, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 0, "ExitCode": 137, "Error": "driver failed programming external connectivity on endpoint kjxy (6206f4102fb1f8a007b2306fc9b9caa3e87abd8e00d4a26a78b72e2242292970): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 7074 -j DNAT --to-destination 172.17.0.6:8080 ! -i docker0: iptables: No chain/target/match by that nam e. (exit status 1))", "StartedAt": "2019-03-20T00:45:14.267504968Z", "FinishedAt": "2019-03-20T01:26:36.1111497Z" },
在网上找了一篇文章
原文链接
https://www.cnblogs.com/hailun1987/p/7518306.html
http://blog.sina.com.cn/s/blog_8ea8e9d50102wwf8.html
原因:
docker服务启动时定义的自定义链DOCKER由于某种原因被清掉
重启docker服务及可重新生成自定义链DOCKER
解决办法:
重启docker服务后再启动容器
systemctl restart docker
问题解决
end
以上是关于docker启动时报错Error response from daemon: driver failed programming external connectivity on endpoint *的主要内容,如果未能解决你的问题,请参考以下文章
docker拉取镜像时报错:docker: Error response from daemon: Get “https://registry-1.docker.io/v2/“: dial tcp:
docker启动时报错Job for docker.service failed because the control process exited with error code. See &qu