欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

stop-and-remove-all-docker-containers-and-images

程序员文章站 2023-12-30 19:04:40
...

转载自 http://blog.baudson.de/blog/stop-and-remove-all-docker-containers-and-images

Sometimes it’s useful to start with a clean slate and remove all Docker containers and even images. Here are some handy shortcuts.

List all containers (only IDs)

docker ps -aq

Stop all containers

docker stop $(docker ps -aq)

Stop all running containers

docker stop $(docker ps -q)

Remove all containers

docker rm $(docker ps -aq)

Remove all images

docker rmi $(docker images -q)

上一篇:

下一篇: