您现在的位置是:热点 >>正文
云计算核心技术Docker教程:Python镜像停止、启动和命名容器
热点84174452人已围观
简介...
您可以启动、停止和重新启动 Docker 容器。当我们停止一个容器时,它并没有被移除,而是状态变成了stopped,容器内的进程也停止云计了。当我们docker ps在上一个模块中运行命令时,默认输出仅显示正在运行的容器。当我们通过--all或-a简称时,我们会看到机器上算核的所有容器,而不管它们的启动或停止状态。
$ docker ps -a
您现在应该看到列出了几个容器。这些是我们启动和停止但尚未删除的容器。
让我心技们重新启动刚刚停止的容器。找到我们刚刚停止的容器名称,在restart命令中替换下面的容器名称。
$ docker restart wonderf术Dul_kalam
现在使用docker ps命令再次列出所有容器。
$ docker ps --all
请注意,我们刚刚重新启动的容器已在分离模式下启oc动并暴露了端口 5000。另外,观察容器的状态是“Up X seconds”。当您重新启动容器时,它会以与最初启动时相同的标志或命令启动。
现在,ke让我们停止并移除我们所有的容器,看看如何修复随机命名问题。停止我们刚刚启动的容器。找到您正在运行的容器的名称,并将以下命令中的名称替r教换为您系统上的容器名称。
$ docker stop wonderful_kalam
现在我们所有的容器都已停止,让我们将它们移除。当你移除一个容程:器时,它不再运行,也不是处于停止状态,而是容器内部的进程已经停止并且容器的元数据已经被移除。
$ docker ps --all
要删除容器Py,只需运行docker rm传递容器名称的命令即可。您可以使用单个命令将多个容器名称传递给命令。同样,将以下命令中的容器名称替换为您系th统中的容器名称。
$ docker rm wonderful_kalam agitated_moser goofy_khayyam
docker ps -on-all再次运行该命令以查看所有容器都已删除。
现在,让我们解决随机命名问题。标准做法是为您的容器命名,原因很简单,这样更容易识别容器中镜像运行的内容以及与它关联的应用程序或服务。
要命名容器,我们只需要将--name标志传递给docker run命令。
$ docker run -停止d -p 5000:5000 --name rest-server python-docker
这样更好!我们现在可以根据名称轻松识别我们的容器。
Tags:
相关文章
神经符号系统、跨学科交互,李飞飞等16名学者共同探讨AI未来
热点去年,纽约大学心理学和神经科学教授 Gary Marcus 和深度学习先驱、2018 年图灵奖得主 Yoshua Bengio 就 AI 技术的发展方向展开了一场现场辩论。 今年,Gary Marcu...
【热点】
阅读更多Epoch不仅过时,而且有害?Reddit机器学习板块展开讨论
热点本文经AI新媒体量子位(公众号ID:QbitAI)授权转载,转载请联系出处。 有一天,一个调参侠在训练一个深度学习模型,要用到的两个数据集损失函数不同,数据集的大小还不是固定的,每天都在增加。 他有点...
【热点】
阅读更多Transformer走下神坛?想解决常识问题,神经网络不是答案
热点NLP研究人员都知道语言模型只能学到语法上下文信息,对于常识性问题则束手无措。南加州大学的一名助理教授最近做客《对话》,阐述了他眼中的常识以及解决方法。他悲观地预测,也许5年、50年才能解决,到底需要...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://nicolazzi.it/en/?s=谷歌霸屏软件【tg:seogoogle987】,tzQ
- https://www.nyif.com/catalogsearch/result/index/?f=sarbanesoxleyU&index=me_cms_pe&lit=20&mode=list&p=1&q=谷歌霸屏软件【tg:seogoogle987】,uno
- https://store.line.me/search/sticker/ja?q=谷歌霸屏软件【tg:seogoogle987】Shg
- https://www.tombow.com/search/谷歌霸屏软件【tg:seogoogle987】,iXx
- https://www.wilsonart.com/catalogsearch/result/?action=CHECK&q=谷歌霸屏软件【tg:seogoogle987】,4wD
- https://www.navylookout.com/?ID=nSBR6Ivdu6lZg1yr2SDs30Lo5sTs76yJ&s=谷歌霸屏软件【tg:seogoogle987】,xmR
- https://www.umc.edu/search.aspx?ID=I4gnDKRS991MFcIDDzoYze4aWSAszAm7&q=谷歌霸屏软件【tg:seogoogle987】,aHh
- https://www.mintos.org/?s=谷歌霸屏软件【tg:seogoogle987】,XUZ
- https://www.sic-info.org/vi/?s=谷歌霸屏软件【tg:seogoogle987】,Vvx
- https://5gaa.org/?token=6e2l7hjt2i26gzgctgwdrv7v0j6nxorq&s=谷歌霸屏软件【tg:seogoogle987】emD
- https://www.dba.dk/soeg/?soeg=谷歌霸屏软件【tg:seogoogle987】d7A
- https://www.kaiyueleather.com/search/谷歌霸屏软件【tg:seogoogle987】,kFj
- https://www.remit.co.jp/vi/?s=谷歌霸屏软件【tg:seogoogle987】86Z
- https://www.rhymezone.com/r/rhyme.cgi?typeofrhyme=oldrel&loc=nojs&Word=谷歌霸屏软件【tg:seogoogle987】,WTO
- https://www.paxnet.co.kr/search/jongmok?kwd=谷歌霸屏软件【tg:seogoogle987】GEA
- https://www.wellbees.com/catalogsearch/result/?action=CHECK&q=谷歌霸屏软件【tg:seogoogle987】,lcF
- https://www.ntv.co.jp/3min/search/?action=QUERY&q=谷歌霸屏软件【tg:seogoogle987】,NOe
- https://www.universal-music.co.jp/search/?q=谷歌霸屏软件【tg:seogoogle987】,1xx
- https://www.losgatoschamber.com/list/search?action=SEARCH&q=谷歌霸屏软件【tg:seogoogle987】,oUp
- https://www.reallywildbirdfood.co.uk/store/search?q=谷歌霸屏软件【tg:seogoogle987】,98o
- https://www.yli.ro/catalogsearch/result/?q=谷歌霸屏软件【tg:seogoogle987】,GJq
- https://www.qwant.com/?q=谷歌霸屏软件【tg:seogoogle987】,zKV
- https://www.wellbees.com/index.php/catalogsearch/result/index/?q=谷歌霸屏软件【tg:seogoogle987】,5z7
- https://www.yidian51.com/taobao/谷歌霸屏软件【tg:seogoogle987】,Rw4
- https://www.pearson.com/en-us/search.html?aq=谷歌霸屏软件【tg:seogoogle987】,kar
- https://www.selfsufficientish.com/main/?s=谷歌霸屏软件【tg:seogoogle987】,ktH
- https://www.swanagerailway.co.uk/search?q=谷歌霸屏软件【tg:seogoogle987】,irM
- https://www.remit.co.jp/vi/?s=谷歌霸屏软件【tg:seogoogle987】,HO6
- https://www.nss.nhs.scot/search?q=谷歌霸屏软件【tg:seogoogle987】,4fF
- https://www.rotherham.gov.uk/site-search/results/?q=谷歌霸屏软件【tg:seogoogle987】,mEC
- https://www.sic-info.org/en/?s=谷歌霸屏软件【tg:seogoogle987】,ANP
- https://www.soccerbible.com/search?q=谷歌霸屏软件【tg:seogoogle987】,h25
- https://www.monroecounty.gov/search/?q=谷歌霸屏软件【tg:seogoogle987】,mzp
- https://www.klatreverden.no/search?q=谷歌霸屏软件【tg:seogoogle987】,obM
- https://www.polar-tech.com/?action=QUERY&s=谷歌霸屏软件【tg:seogoogle987】,8no
- https://www.swecobelgium.be/?page=9&s=谷歌霸屏软件【tg:seogoogle987】,Cw0
- https://www.abbreviations.com/谷歌霸屏软件【tg:seogoogle987】3ch
- https://www.safetv.go.kr/base/search/view?searchWord=谷歌霸屏软件【tg:seogoogle987】DF1
- https://www.world-architects.com/en/search?term=谷歌霸屏软件【tg:seogoogle987】,SOF
- https://www.l-and-b.jp/?page=1&s=谷歌霸屏软件【tg:seogoogle987】,Dwb
- https://www.madebyoranges.com/nl/search/谷歌霸屏软件【tg:seogoogle987】,fv4
- https://www.televes.com/es/catalogsearch/result/?q=谷歌霸屏软件【tg:seogoogle987】,nGe
- https://www.impactpool.org/search/?type=79&q=谷歌霸屏软件【tg:seogoogle987】QX4
- https://www.mi.com/search?keyword=谷歌霸屏软件【tg:seogoogle987】,bn0
- https://www.prattlibrary.org/search?q=谷歌霸屏软件【tg:seogoogle987】,goe
- https://www.sic-info.org/?s=谷歌霸屏软件【tg:seogoogle987】,ZaV
- https://www.krisinformation.se/en/search?q=谷歌霸屏软件【tg:seogoogle987】,K0r
- https://www.zutari.com/?s=谷歌霸屏软件【tg:seogoogle987】,CJk
- https://www.parl.ca/legisinfo/fr/projets-de-loi?parlsession=all&view=list&keywords=谷歌霸屏软件【tg:seogoogle987】,KHt
- https://www.tcv.org.uk/search/谷歌霸屏软件【tg:seogoogle987】,RkI