[英]Docker container not running even when I did docker start container ID
I am trying to dockerise a python application I built. 我正在尝试将我构建的python应用程序码头化。
Basically, I ran docker and was able to build successfully the first time round. 基本上,我运行docker并能够在第一轮成功构建。 I made a slight change to the python application and I re-ran the build and run command.
我对python应用程序做了些微更改,然后重新运行了build and run命令。
vagrant@ansible:~/Desktop/braintree_example_docker$ sudo docker run -d -p 5000:5000 python-braintree-app
906760d4eb5484c4feb7d47c3cf394aa20604eefa22b82157c870440b14c6f4d
However, when I did a docker PS: nothing was shown. 但是,当我执行docker PS时:没有显示任何内容。
I then did a docker ps-a and it showed the below 然后我做了一个docker ps-a,它显示了以下内容
vagrant@ansible:~/Desktop/braintree_example_docker$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
906760d4eb54 python-braintree-app "python app.py" 5 minutes ago Exited (0) 3 minutes ago goofy_pike
016ceba53f9d python-braintree-app "python app.py" 9 minutes ago Exited (0) 8 minutes ago pedantic_chebyshev
9e23e8412f63 python-braintree-app "python app.py" 10 minutes ago Exited (0) 10 minutes ago nosta
I tried to do a docker start 906760d4eb5484c4feb7d47c3cf394aa20604eefa22b82157c870440b14c6f4d
but still shows docker ps as nothing. 我试图做一个
docker start 906760d4eb5484c4feb7d47c3cf394aa20604eefa22b82157c870440b14c6f4d
但仍然显示docker start 906760d4eb5484c4feb7d47c3cf394aa20604eefa22b82157c870440b14c6f4d
ps为docker start 906760d4eb5484c4feb7d47c3cf394aa20604eefa22b82157c870440b14c6f4d
。
What am i doing wrong? 我究竟做错了什么?
PS: a newbie to docker sp please excuse the silly question PS:docker sp的新手,请问这个傻问题
A second question, is if I made a code change into my Python application, do I need to rebuild my image? 第二个问题是,如果我对Python应用程序进行了代码更改,是否需要重建映像?
To answer this question as rightly pointed out by cricket_007, I had to add in a host and port in my code. 为了回答cricket_007正确指出的这个问题,我必须在代码中添加主机和端口。
this was the cause of my issue 这是我问题的原因
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.