Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f49dc528ed29e6285c24ef356652cc8bc637c8c7)
Signed-off-by: Tibor Vass <tibor@docker.com>
| 34 | 35 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,65 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "stack services" |
|
| 2 |
+description = "The stack services command description and usage" |
|
| 3 |
+keywords = ["stack, services"] |
|
| 4 |
+advisory = "experimental" |
|
| 5 |
+[menu.main] |
|
| 6 |
+parent = "smn_cli" |
|
| 7 |
+<![end-metadata]--> |
|
| 8 |
+ |
|
| 9 |
+# stack services (experimental) |
|
| 10 |
+ |
|
| 11 |
+```markdown |
|
| 12 |
+Usage: docker stack services [OPTIONS] STACK |
|
| 13 |
+ |
|
| 14 |
+List the services in the stack |
|
| 15 |
+ |
|
| 16 |
+Options: |
|
| 17 |
+ -f, --filter value Filter output based on conditions provided |
|
| 18 |
+ --help Print usage |
|
| 19 |
+ -q, --quiet Only display IDs |
|
| 20 |
+``` |
|
| 21 |
+ |
|
| 22 |
+Lists the services that are running as part of the specified stack. This |
|
| 23 |
+command has to be run targeting a manager node. |
|
| 24 |
+ |
|
| 25 |
+For example, the following command shows all services in the `myapp` stack: |
|
| 26 |
+ |
|
| 27 |
+```bash |
|
| 28 |
+$ docker stack services myapp |
|
| 29 |
+ |
|
| 30 |
+ID NAME REPLICAS IMAGE COMMAND |
|
| 31 |
+7be5ei6sqeye myapp_web 1/1 nginx@sha256:23f809e7fd5952e7d5be065b4d3643fbbceccd349d537b62a123ef2201bc886f |
|
| 32 |
+dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 |
|
| 33 |
+``` |
|
| 34 |
+ |
|
| 35 |
+## Filtering |
|
| 36 |
+ |
|
| 37 |
+The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there |
|
| 38 |
+is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). |
|
| 39 |
+Multiple filter flags are combined as an `OR` filter. |
|
| 40 |
+ |
|
| 41 |
+The following command shows both the `web` and `db` services: |
|
| 42 |
+ |
|
| 43 |
+```bash |
|
| 44 |
+$ docker stack services --filter name=myapp_web --filter name=myapp_db myapp |
|
| 45 |
+ |
|
| 46 |
+ID NAME REPLICAS IMAGE COMMAND |
|
| 47 |
+7be5ei6sqeye myapp_web 1/1 nginx@sha256:23f809e7fd5952e7d5be065b4d3643fbbceccd349d537b62a123ef2201bc886f |
|
| 48 |
+dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 |
|
| 49 |
+``` |
|
| 50 |
+ |
|
| 51 |
+The currently supported filters are: |
|
| 52 |
+ |
|
| 53 |
+* id / ID (`--filter id=7be5ei6sqeye`, or `--filter ID=7be5ei6sqeye`) |
|
| 54 |
+* name (`--filter name=myapp_web`) |
|
| 55 |
+* label (`--filter label=key=value`) |
|
| 56 |
+ |
|
| 57 |
+## Related information |
|
| 58 |
+ |
|
| 59 |
+* [stack config](stack_config.md) |
|
| 60 |
+* [stack deploy](stack_deploy.md) |
|
| 61 |
+* [stack rm](stack_rm.md) |
|
| 62 |
+* [stack tasks](stack_tasks.md) |