Docker 停止删除所有容器

1、停止所有容器

docker stop $(docker ps -aq)

2、删除所有停止的容器

docker container prune

 aq的含义

Options:
-a, --all Show all containers (default shows just running)
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print containers using a Go template
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display container IDs
-s, --size Display total file sizes

posted @ 2021-05-20 09:35  zhaogaojian  阅读(3814)  评论(0编辑  收藏  举报