docker ps命令-列出所有容器

ps 列出所有容器

Usage: docker ps [OPTIONS]List containers


-a,--all=falseShow all containers.Only running containers are shown bydefault.--before=""Show only container created before IdorName, include non-running ones.-l,--latest=falseShow only the latest created container, include non-running ones.-n=-1Show n last created containers, include non-running ones.--no-trunc=falseDon't truncate output
-q, --quiet=false Only display numeric IDs
-s, --size=false Display sizes
--since="" Show only containers created since Id or Name, include non-running ones.

Running docker ps showing 2 linked containers.

$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4c01db0b339c ubuntu:12.04 bash 17 seconds ago Up16 seconds webapp
d7886598dbe2 crosbymichael
/redis:latest /redis-server --dir 33 minutes ago Up33 minutes 6379/tcp redis,webapp/db

docker ps  默认显示运行的容器,显示所有容器:  docker ps -a