搜索

[Docker]How to run CentOS in Docker container


发布时间: 2022-11-24 19:35:00    浏览次数:75 次

docker pull centos

docker images

docker run -d -i -p 10000:80 centos

docker ps

 

为什么需要加 -i 的参数:

Nothing is actively running. That makes sense, because we’re not telling the containerized OS to do anything 
— it starts, it doesn’t have anything to do, and so it shuts down immediately. 
Instead we can tell it to run interactively and with a terminal by specifying a couple options:

-i, --interactive
-t, --tty (“allocate a pseudo-TTY”, i.e. a terminal)
(see docker run --help for details)

 

免责声明 [Docker]How to run CentOS in Docker container,资源类别:文本, 浏览次数:75 次, 文件大小:-- , 由本站蜘蛛搜索收录2022-11-24 07:35:00。此页面由程序自动采集,只作交流和学习使用,本站不储存任何资源文件,如有侵权内容请联系我们举报删除, 感谢您对本站的支持。 原文链接:https://www.cnblogs.com/MoKinLi/p/16922977.html