Skip to content

Commit 2ee828a

Browse files
authored
Merge pull request moby#24802 from vdemeester/stack-docs-and-flags
Add documentation for stack commands
2 parents ffba13f + 10919e8 commit 2ee828a

File tree

6 files changed

+227
-2
lines changed

6 files changed

+227
-2
lines changed

api/client/stack/opts.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
)
1313

1414
func addBundlefileFlag(opt *string, flags *pflag.FlagSet) {
15-
flags.StringVarP(
15+
flags.StringVar(
1616
opt,
17-
"bundle", "f", "",
17+
"bundle", "",
1818
"Path to a Distributed Application Bundle file (Default: STACK.dab)")
1919
}
2020

docs/reference/commandline/deploy.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!--[metadata]>
2+
+++
3+
title = "deploy"
4+
description = "The deploy command description and usage"
5+
keywords = ["stack, deploy"]
6+
advisory = "experimental"
7+
[menu.main]
8+
parent = "smn_cli"
9+
+++
10+
<![end-metadata]-->
11+
12+
# stack deploy (experimental)
13+
14+
```markdown
15+
Usage: docker deploy [OPTIONS] STACK
16+
17+
Create and update a stack from a Distributed Application Bundle (DAB)
18+
19+
Options:
20+
--bundle string Path to a Distributed Application Bundle file (Default: STACK.dab)
21+
--help Print usage
22+
```
23+
24+
Create and update a stack from a `dab` file. This command has to be
25+
run targeting a manager node.
26+
27+
```bash
28+
$ docker deploy vossibility-stack
29+
Loading bundle from vossibility-stack.dab
30+
Creating service vossibility-stack_elasticsearch
31+
Creating service vossibility-stack_kibana
32+
Creating service vossibility-stack_logstash
33+
Creating service vossibility-stack_lookupd
34+
Creating service vossibility-stack_nsqd
35+
Creating service vossibility-stack_vossibility-collector
36+
```
37+
38+
You can verify that the services were correctly created:
39+
40+
```bash
41+
$ docker service ls
42+
ID NAME REPLICAS IMAGE
43+
COMMAND
44+
29bv0vnlm903 vossibility-stack_lookupd 1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 /nsqlookupd
45+
4awt47624qwh vossibility-stack_nsqd 1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 /nsqd --data-path=/data --lookupd-tcp-address=lookupd:4160
46+
4tjx9biia6fs vossibility-stack_elasticsearch 1 elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
47+
7563uuzr9eys vossibility-stack_kibana 1 kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
48+
9gc5m4met4he vossibility-stack_logstash 1 logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe logstash -f /etc/logstash/conf.d/logstash.conf
49+
axqh55ipl40h vossibility-stack_vossibility-collector 1 icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba --config /config/config.toml --debug
50+
```
51+
52+
## Related information
53+
54+
* [stack config](stack_config.md)
55+
* [stack deploy](stack_deploy.md)
56+
* [stack rm](stack_rm.md)
57+
* [stack tasks](stack_tasks.md)
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--[metadata]>
2+
+++
3+
title = "stack config"
4+
description = "The stack config command description and usage"
5+
keywords = ["stack, config"]
6+
advisory = "experimental"
7+
[menu.main]
8+
parent = "smn_cli"
9+
+++
10+
<![end-metadata]-->
11+
12+
# stack config (experimental)
13+
14+
```markdown
15+
Usage: docker stack config [OPTIONS] STACK
16+
17+
Print the stack configuration
18+
19+
Options:
20+
--bundle string Path to a Distributed Application Bundle file (Default: STACK.dab)
21+
--help Print usage
22+
```
23+
24+
Displays the configuration of a stack.
25+
26+
## Related information
27+
28+
* [stack deploy](stack_deploy.md)
29+
* [stack rm](stack_rm.md)
30+
* [stack tasks](stack_tasks.md)
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!--[metadata]>
2+
+++
3+
title = "stack deploy"
4+
description = "The stack deploy command description and usage"
5+
keywords = ["stack, deploy, up"]
6+
advisory = "experimental"
7+
[menu.main]
8+
parent = "smn_cli"
9+
+++
10+
<![end-metadata]-->
11+
12+
# stack deploy (experimental)
13+
14+
```markdown
15+
Usage: docker stack deploy [OPTIONS] STACK
16+
17+
Create and update a stack from a Distributed Application Bundle (DAB)
18+
19+
Aliases:
20+
deploy, up
21+
22+
Options:
23+
--bundle string Path to a Distributed Application Bundle file (Default: STACK.dab)
24+
--help Print usage
25+
```
26+
27+
Create and update a stack from a `dab` file on the swarm. This command
28+
has to be run targeting a manager node.
29+
30+
```bash
31+
$ docker stack deploy vossibility-stack
32+
Loading bundle from vossibility-stack.dab
33+
Creating service vossibility-stack_elasticsearch
34+
Creating service vossibility-stack_kibana
35+
Creating service vossibility-stack_logstash
36+
Creating service vossibility-stack_lookupd
37+
Creating service vossibility-stack_nsqd
38+
Creating service vossibility-stack_vossibility-collector
39+
```
40+
41+
You can verify that the services were correctly created:
42+
43+
```bash
44+
$ docker service ls
45+
ID NAME REPLICAS IMAGE
46+
COMMAND
47+
29bv0vnlm903 vossibility-stack_lookupd 1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 /nsqlookupd
48+
4awt47624qwh vossibility-stack_nsqd 1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 /nsqd --data-path=/data --lookupd-tcp-address=lookupd:4160
49+
4tjx9biia6fs vossibility-stack_elasticsearch 1 elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
50+
7563uuzr9eys vossibility-stack_kibana 1 kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
51+
9gc5m4met4he vossibility-stack_logstash 1 logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe logstash -f /etc/logstash/conf.d/logstash.conf
52+
axqh55ipl40h vossibility-stack_vossibility-collector 1 icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba --config /config/config.toml --debug
53+
```
54+
55+
## Related information
56+
57+
* [stack config](stack_config.md)
58+
* [stack rm](stack_rm.md)
59+
* [stack tasks](stack_tasks.md)
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--[metadata]>
2+
+++
3+
title = "stack rm"
4+
description = "The stack rm command description and usage"
5+
keywords = ["stack, rm, remove, down"]
6+
advisory = "experimental"
7+
[menu.main]
8+
parent = "smn_cli"
9+
+++
10+
<![end-metadata]-->
11+
12+
# stack rm (experimental)
13+
14+
```markdown
15+
Usage: docker stack rm STACK
16+
17+
Remove the stack
18+
19+
Aliases:
20+
rm, remove, down
21+
22+
Options:
23+
--help Print usage
24+
```
25+
26+
Remove the stack from the swarm. This command has to be run targeting
27+
a manager node.
28+
29+
## Related information
30+
31+
* [stack config](stack_config.md)
32+
* [stack deploy](stack_deploy.md)
33+
* [stack tasks](stack_tasks.md)
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!--[metadata]>
2+
+++
3+
title = "stack tasks"
4+
description = "The stack tasks command description and usage"
5+
keywords = ["stack, tasks"]
6+
advisory = "experimental"
7+
[menu.main]
8+
parent = "smn_cli"
9+
+++
10+
<![end-metadata]-->
11+
12+
# stack tasks (experimental)
13+
14+
```markdown
15+
Usage: docker stack tasks [OPTIONS] STACK
16+
17+
List the tasks in the stack
18+
19+
Options:
20+
-a, --all Display all tasks
21+
-f, --filter value Filter output based on conditions provided
22+
--help Print usage
23+
--no-resolve Do not map IDs to Names
24+
```
25+
26+
Lists the tasks that are running as part of the specified stack. This
27+
command has to be run targeting a manager node.
28+
29+
## Filtering
30+
31+
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
32+
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
33+
Multiple filter flags are combined as an `OR` filter. For example,
34+
`-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks.
35+
36+
The currently supported filters are:
37+
38+
* [id](#id)
39+
* [name](#name)
40+
* [desired-state](#desired-state)
41+
42+
## Related information
43+
44+
* [stack config](stack_config.md)
45+
* [stack deploy](stack_deploy.md)
46+
* [stack rm](stack_rm.md)

0 commit comments

Comments
 (0)