by Devin Yang

建立于: 8年前 ( 更新: 8年前 )

有时在自己的环境中试了一堆container或是images,如何全部移掉系统中所有的images及container 呢?
这些命令提供给大家参考: 

请注意,您确实了解docker中container及images是什么东西。
请勿随意运行如下的命令,在上线中的主机上:


stop all containers: 停止所有的container

docker kill $(docker ps -q)

remove all containers: 移除所有的container
docker rm $(docker ps -qa)

remove all docker images: 移除所有的docker images
docker rmi $(docker images -q)


注: 关於docker stop及docker kill差异,我们可透过如下命令查看说明:
docker help stop
The main process inside the container will receive SIGTERM, and after a grace period, SIGKILL.

docker help kill
The main process inside the container will be sent SIGKILL, or any signal specified with option --signal.

Tags: docker

Devin Yang

文章内容无法一一说明,如果您有什么不了解处,欢印提问哦:)

No Comment

Post your comment

需要登入才可留言!

类似文章


d-laravel,docker

D-Laravel v1.2.1版变更说明(建议更新,必免踩雷)

D-Laravel v1.2.1版修正说明 use GuzzleHttp\Client; 进行post时.出现访问被拒的问题。 如果您是由旧版升级,您可能需调整etc/default-ssl.conf的设置档 (如果有该档) 请调整php:9000变更为web:9000,你可以透过运行一次./console secure调整。 docker-compose设置档部份,PHP-FPM container变更为network_mode: "service:web"...

docker,laravel,nfs

Docker在macOS上的NFS

D-laravel的nfs模式,在这篇文章您可以了解到,如何在macOS使用NFS+Docker。

openai,flax,docker

用容器跑OpenAI官方教程的Python(Flax)

如果您登录了openai的网站,可在此处看到官方的教程说明https://beta.openai.com/docs/quickstart/build-your-applicationAPI的KEY的申请,就在这页的下方就有按钮了+ Create new secret key本篇教您用Docker跑官方OpenAI运行环境。