2.37. Docker ps command

发布时间 : 2025-10-25 13:32:34 UTC      

Page Views: 10 views

Docker 命令大全

docker ps : List containers

2.37.1. Grammar

docker ps [OPTIONS] 

OPTIONS description:

  • -a : Displays all containers, including those that are not running.

  • -f : Filter the displayed content based on the criteria.

  • –format : Specifies the template file for the return value.

  • -l : Displays the most recently created container.

  • -n : List the most recently created n containers.

  • –no-trunc : The output is not truncated.

  • -q : Silent mode, showing only the container number.

  • -s : Displays the total file size.

2.37.2. Example

Lists all running container information.

runoob@runoob:~$ docker ps CONTAINER ID IMAGE COMMAND ... PORTS NAMES 09b93464c2f7 nginx:latest "nginx -g 'daemon off" ... 80/tcp, 443/tcp myrunoob 96f7f14e99ab mysql:5.6 "docker-entrypoint.sh" ... 0.0.0.0:3306->3306/tcp mymysql 

Description of output details:

CONTAINER ID: Container ID.

IMAGE: The mirror image used.

COMMAND: The command that runs when the container is started.

CREATED: The time when the container was created.

STATUS: Container status.

There are 7 states:

  • Created (created)

  • Restarting (restarting)

  • Running (running)

  • Removing (migrating)

  • Paused (pause)

  • Exited (stop)

  • Dead (death)

PORTS: The port information of the container and the connection type used (tcpudp).

NAMES: The container name that is automatically assigned.

Lists the information of the 5 recently created containers.

runoob@runoob:~$ docker ps -n 5 CONTAINER ID IMAGE COMMAND CREATED 09b93464c2f7 nginx:latest "nginx -g 'daemon off" 2 days ago ... b8573233d675 nginx:latest "/bin/bash" 2 days ago ... b1a0703e41e7 nginx:latest "nginx -g 'daemon off" 2 days ago ... f46fb1dec520 5c6e1090e771 "/bin/sh -c 'set -x \t" 2 days ago ... a63b4a5597de 860c279d2fec "bash" 2 days ago ... 

Lists all created container ID.

runoob@runoob:~$ docker ps -a -q 09b93464c2f7 b8573233d675 b1a0703e41e7 f46fb1dec520 a63b4a5597de 6a4aa42e947b de7bb36e7968 43a432b73776 664a8ab1a585 ba52eb632bbd ... 

Docker 命令大全

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。