码迷,mamicode.com
首页 > 其他好文 > 详细

docker启动时报错Error response from daemon: driver failed programming external connectivity on endpoint *

时间:2019-03-20 10:39:19      阅读:2343      评论:0      收藏:0      [点我收藏+]

标签:rom   app   state   服务器   nal   local   tables   详细   started   

公司服务器由于断电重启,部署在docker服务上的一些web服务需要重新开启容器,

[root@localhost ~]# 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服务页面无法访问

[root@localhost ~]# 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
[root@localhost ~]# docker start kjxy
kjxy
[root@localhost ~]#
[root@localhost ~]# 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
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]#
[root@localhost ~]# systemctl is-active firewalld
inactive

 

于是重新启动了一下容器,报如下错误

[root@localhost ~]# docker stop kjxy
kjxy
[root@localhost ~]#
[root@localhost ~]# 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
[root@localhost ~]#

 

查看容器详细信息

[root@localhost ~]# 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.\n (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 *

标签:rom   app   state   服务器   nal   local   tables   详细   started   

原文地址:https://www.cnblogs.com/djlsunshine/p/10563132.html

(5)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!