仅列出停止的Docker容器 [英] List only stopped Docker containers

查看:76
本文介绍了仅列出停止的Docker容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Docker提供了一种列出正在运行的容器或所有容器(包括已停止的容器)的方法。

Docker gives you a way of listing running containers or all containers including stopped ones.

这可以通过以下方式完成:

This can be done by:

$ docker ps # To list running containers

或按

$ docker ps -a # To list running and stopped containers

我们是否只能列出已停止的容器?

Do we have a way of only listing containers that have been stopped?

推荐答案

只能使用以下命令列出停止的容器:

Only stopped containers can be listed using:

docker ps --filter "status=exited"

docker ps -f "status=exited"

这篇关于仅列出停止的Docker容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆