Docker容器不是第二次启动(iptables) [英] Docker container not starting a second time (iptables)

查看:543
本文介绍了Docker容器不是第二次启动(iptables)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用本指南 http://docs.graylog.org/en /1.1/pages/installation/docker.html 我在Ubuntu 14.04服务器上设置了一个Docker容器。



首次使用命令wors启动容器。

  docker运行-t -p 9000:9000 -p 12201:12201 graylog2 / allinone 

我比可以打开端口9000上公开的Web界面。



当我停止容器并尝试使用相同的命令再次运行它时,我得到这个错误:

 守护进程的错误响应:无法启动容器c5cc5831fe854801345ffa2370fdb4f00f4182e209fe1af78233c93be3952bb1:
iptables失败:iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 12201 -j
DNAT - 目的地172.17.0.9:12201! -i docker0:iptables:没有链/目标/匹配的名称。
(退出状态1)

使用任何-p参数启动容器会导致运行容器但港口似乎没有暴露出来。我无法访问Web界面。
docker ps的输出看起来像这样:

  84d322d35d58 graylog2 / allinone/ opt / graylog / embedd 9分钟前Up 9分钟
443 / tcp,514 / tcp,4001 / tcp,9000 / tcp,514 / udp,
12201 / tcp,12900 / tcp,12201 / udp focused_elion $ b $对于我来说,端口看起来像是暴露的,但是主机没有将请求转发到Docker容器。



删除容器并重新安装Docker,而不是再次安装Container,它将在第一次启动时再次工作,但第二次失败。



欢迎任何提示或指针!

解决方案

希望docs.docker中的以下段落。 com可以帮助你。为我工作...


糟糕!刚刚停止容器后,你会打电话说
另一个开发者需要容器,从这里你有两个
cho ices:您可以创建一个新的容器或重新启动旧容器。让我们
看看开始我们以前的容器备份。

  $ docker start nostalgic_morse 
nostalgic_morse

现在,再次快速运行 docker ps -l <​​/ code>运行容器是
备份或浏览到容器的URL以查看应用程序
是否响应。



注意:docker restart命令还可用
,然后从容器开始。



Using this guide http://docs.graylog.org/en/1.1/pages/installation/docker.html I set up an Docker container on my Ubuntu 14.04 server.

Starting the container the first time using the command wors as expected.

docker run -t -p 9000:9000 -p 12201:12201 graylog2/allinone

I than am able to open the web interface exposed on port 9000.

When I stop the Container and try to run it again with the same command I get this error:

Error response from daemon: Cannot start container  c5cc5831fe854801345ffa2370fdb4f00f4182e209fe1af78233c93be3952bb1:
iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 12201 -j 
DNAT --to-destination 172.17.0.9:12201 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)

Starting the container with out any -p parameter leads to a running container. But the ports seem not to be exposed. I'm not able to access the web interface. The output of "docker ps" looks then like this:

84d322d35d58        graylog2/allinone   "/opt/graylog/embedd   9 minutes ago       Up 9 minutes        
443/tcp, 514/tcp, 4001/tcp, 9000/tcp, 514/udp, 
12201/tcp, 12900/tcp, 12201/udp   focused_elion  

For me it looks like the ports are exposed. But the host machine is not forwarding the requests to the Docker Container.

After removing the container and reinstalling Docker and than installing the Container again it is working again on the first start. But fails on the second time.

Any tips or pointers are welcome!

解决方案

Hope the following paragraph from docs.docker.com can help you.Worked for me ...

Oops! Just after you stopped the container you get a call to say another developer needs the container back. From here you have two choices: you can create a new container or restart the old one. Let’s look at starting our previous container back up.

$ docker start nostalgic_morse
nostalgic_morse

Now quickly run docker ps -l again to see the running container is back up or browse to the container’s URL to see if the application responds.

Note: Also available is the docker restart command that runs a stop and then start on the container.

这篇关于Docker容器不是第二次启动(iptables)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆