AdSense

網頁

2019/9/3

Docker 查詢運行中的容器 list running containers

查看Docker目前運行中的容器(Container)的指令如下。

輸入docker container ls即可列出Docker運行中的containers。

$ docker container ls
CONTAINER ID        IMAGE                                       COMMAND                  CREATED             STATUS                    PORTS                NAMES
69634550eece        store/oracle/database-enterprise:12.2.0.1   "/bin/sh -c '/bin/ba…"   25 minutes ago      Up 25 minutes (healthy)   1521/tcp, 5500/tcp   mydb

或輸入docker ps也可列出運行中的containers。

$ docker ps
CONTAINER ID        IMAGE                                       COMMAND                  CREATED             STATUS                    PORTS                NAMES
69634550eece        store/oracle/database-enterprise:12.2.0.1   "/bin/sh -c '/bin/ba…"   25 minutes ago      Up 25 minutes (healthy)   1521/tcp, 5500/tcp   mydb

若要列出所有的container,也就是包含未運行的容器,使用docker ps --all或簡寫為docker ps -a

$ docker ps -a
CONTAINER ID        IMAGE                                       COMMAND                  CREATED             STATUS                    PORTS                NAMES
69634550eece        store/oracle/database-enterprise:12.2.0.1   "/bin/sh -c '/bin/ba…"   25 minutes ago      Up 25 minutes (healthy)   1521/tcp, 5500/tcp   mydb
2e33400c9c6c        nginx                                       "nginx -g 'daemon of…"   4 weeks ago         Exited (0) 4 weeks ago                         webserver


參考:

沒有留言:

AdSense