Browse code

docs: add initial reference for "stack services"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2016/07/21 01:54:48
Showing 5 changed files
... ...
@@ -27,4 +27,5 @@ Displays the configuration of a stack.
27 27
 
28 28
 * [stack deploy](stack_deploy.md)
29 29
 * [stack rm](stack_rm.md)
30
+* [stack services](stack_services.md)
30 31
 * [stack tasks](stack_tasks.md)
... ...
@@ -56,4 +56,5 @@ axqh55ipl40h  vossibility-stack_vossibility-collector  1 icecrime/vossibility-co
56 56
 
57 57
 * [stack config](stack_config.md)
58 58
 * [stack rm](stack_rm.md)
59
+* [stack services](stack_services.md)
59 60
 * [stack tasks](stack_tasks.md)
... ...
@@ -30,4 +30,5 @@ a manager node.
30 30
 
31 31
 * [stack config](stack_config.md)
32 32
 * [stack deploy](stack_deploy.md)
33
+* [stack services](stack_services.md)
33 34
 * [stack tasks](stack_tasks.md)
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)
... ...
@@ -44,3 +44,4 @@ The currently supported filters are:
44 44
 * [stack config](stack_config.md)
45 45
 * [stack deploy](stack_deploy.md)
46 46
 * [stack rm](stack_rm.md)
47
+* [stack services](stack_services.md)