1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Options: --all , -a 显示所有容器,默认只显示运行的容器 --filter , -f 过滤显示 --format 指定显示格式 --last , -n 显示n个已创建的容器,包括所有状态,默认为-1,即最后一个创建的容器 --latest , -l 显示最后一个创建的容器 --no-trunc 不要截断显示 --quiet , -q 只显示容器ID --size , -s 显示文件大小
--filter Filter Description id Container’s ID name Container’s name label An arbitrary string representing either a key or a key-value pair. Expressed as <key> or <key>=<value> exited An integer representing the container’s exit code. Only useful with --all. status One of created, restarting, running, removing, paused, exited, or dead ancestor Filters containers which share a given image as an ancestor. Expressed as <image-name>[:<tag>], <image id>, or <image@digest> before or since Filters containers created before or after a given container ID or name volume Filters running containers which have mounted a given volume or bind mount. network Filters running containers connected to a given network. publish or expose Filters containers which publish or expose a given port. Expressed as <port>[/<proto>] or <startport-endport>/[<proto>] health Filters containers based on their healthcheck status. One of starting, healthy, unhealthy or none. is-task Filters containers that are a “task” for a service. Boolean option (true or false)
--format .ID Container ID .Image Image ID .Command Quoted command .CreatedAt Time when the container was created. .RunningFor Elapsed time since the container was started. .Ports Exposed ports. .State Container status (for example; “created”, “running”, “exited”). .Status Container status with details about duration and health-status. .Size Container disk size. .Names Container names. .Labels All labels assigned to the container. .Label Value of a specific label for this container. For example '{{.Label "com.docker.swarm.cpu"}}' .Mounts Names of the volumes mounted in this container. .Networks Names of the networks attached to this container.
|