[英]how to run docker container from python image?
I pulled a python image from hub images doing docker pull python:3.9-alpine
.我从执行
docker pull python:3.9-alpine
的中心图像中提取了一个 python 图像。
Then i tried to launch the container from this image doing like docker run -p 8888:8888 --name test_container d4d6be1b90ec
.然后我尝试从这个图像启动容器,就像
docker run -p 8888:8888 --name test_container d4d6be1b90ec
。 The container is never up.容器永远不会启动。 with docker ps i didn't find it.
docker ps 我没找到。
Do you know why please?请问你知道为什么吗?
Thank you,谢谢你,
Your container is not launched because there is no server(nginx,apache etc..) to point, there is only python and the necessary dependencies.您的容器未启动,因为没有服务器(nginx、apache 等)指向,只有 python 和必要的依赖项。
In order to run that image you can try the following command:为了运行该图像,您可以尝试以下命令:
docker run --name test_python -it [id_image]
docker 运行 --name test_python -it [id_image]
And if you open another terminal and use docker ps
you will see that the container is up.如果你打开另一个终端并使用
docker ps
你会看到容器已经启动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.