Переглянути джерело

fix docs to reflect docker compose ps being aligned with docker ps

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 2 роки тому
батько
коміт
4721c01702
2 змінених файлів з 34 додано та 28 видалено
  1. 17 14
      docs/reference/compose_ps.md
  2. 17 14
      docs/reference/docker_compose_ps.yaml

+ 17 - 14
docs/reference/compose_ps.md

@@ -20,13 +20,20 @@ List containers
 ## Description
 
 Lists containers for a Compose project, with current status and exposed ports.
-By default, both running and stopped containers are shown:
 
 ```console
 $ docker compose ps
-NAME           COMMAND                  SERVICE   STATUS       PORTS
-example-bar-1  "/docker-entrypoint.…"   bar       exited (0)
-example-foo-1  "/docker-entrypoint.…"   foo       running      0.0.0.0:8080->80/tcp
+NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
+```
+
+By default, only running containers are shown. `--all` flag can be used to include stopped containers
+
+```console
+$ docker compose ps --all
+NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
+example-bar-1   alpine    "/entrypoint.…"   bar        4 seconds ago   exited (0)
 ```
 
 ## Examples
@@ -89,12 +96,12 @@ to show only containers that are running or only containers that have exited:
 
 ```console
 $ docker compose ps --status=running
-NAME           COMMAND                  SERVICE   STATUS       PORTS
-example-foo-1  "/docker-entrypoint.…"   foo       running      0.0.0.0:8080->80/tcp
+NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
 
 $ docker compose ps --status=exited
-NAME           COMMAND                  SERVICE   STATUS       PORTS
-example-bar-1  "/docker-entrypoint.…"   bar       exited (0)
+NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+example-bar-1   alpine    "/entrypoint.…"   bar        4 seconds ago   exited (0)
 ```
 
 ### <a name="filter"></a> Filter containers by status (--filter)
@@ -105,12 +112,8 @@ this time using the `--filter` flag:
 
 ```console
 $ docker compose ps --filter status=running
-NAME           COMMAND                  SERVICE   STATUS       PORTS
-example-foo-1  "/docker-entrypoint.…"   foo       running      0.0.0.0:8080->80/tcp
-
-$ docker compose ps --filter status=running
-NAME           COMMAND                  SERVICE   STATUS       PORTS
-example-bar-1  "/docker-entrypoint.…"   bar       exited (0)
+NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
 ```
 
 The `docker compose ps` command currently only supports the `--filter status=<status>`

+ 17 - 14
docs/reference/docker_compose_ps.yaml

@@ -2,13 +2,20 @@ command: docker compose ps
 short: List containers
 long: |-
     Lists containers for a Compose project, with current status and exposed ports.
-    By default, both running and stopped containers are shown:
 
     ```console
     $ docker compose ps
-    NAME           COMMAND                  SERVICE   STATUS       PORTS
-    example-bar-1  "/docker-entrypoint.…"   bar       exited (0)
-    example-foo-1  "/docker-entrypoint.…"   foo       running      0.0.0.0:8080->80/tcp
+    NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+    example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
+    ```
+
+    By default, only running containers are shown. `--all` flag can be used to include stopped containers
+
+    ```console
+    $ docker compose ps --all
+    NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+    example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
+    example-bar-1   alpine    "/entrypoint.…"   bar        4 seconds ago   exited (0)
     ```
 usage: docker compose ps [OPTIONS] [SERVICE...]
 pname: docker compose
@@ -139,12 +146,12 @@ examples: |-
 
     ```console
     $ docker compose ps --status=running
-    NAME           COMMAND                  SERVICE   STATUS       PORTS
-    example-foo-1  "/docker-entrypoint.…"   foo       running      0.0.0.0:8080->80/tcp
+    NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+    example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
 
     $ docker compose ps --status=exited
-    NAME           COMMAND                  SERVICE   STATUS       PORTS
-    example-bar-1  "/docker-entrypoint.…"   bar       exited (0)
+    NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+    example-bar-1   alpine    "/entrypoint.…"   bar        4 seconds ago   exited (0)
     ```
 
     ### Filter containers by status (--filter) {#filter}
@@ -155,12 +162,8 @@ examples: |-
 
     ```console
     $ docker compose ps --filter status=running
-    NAME           COMMAND                  SERVICE   STATUS       PORTS
-    example-foo-1  "/docker-entrypoint.…"   foo       running      0.0.0.0:8080->80/tcp
-
-    $ docker compose ps --filter status=running
-    NAME           COMMAND                  SERVICE   STATUS       PORTS
-    example-bar-1  "/docker-entrypoint.…"   bar       exited (0)
+    NAME            IMAGE     COMMAND           SERVICE    CREATED         STATUS          PORTS
+    example-foo-1   alpine    "/entrypoint.…"   foo        4 seconds ago   Up 2 seconds    0.0.0.0:8080->80/tcp
     ```
 
     The `docker compose ps` command currently only supports the `--filter status=<status>`