Signed-off-by: Amit Shukla <amit.shukla@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
| ... | ... |
@@ -86,3 +86,23 @@ You start the Docker daemon with the command line. How you start the daemon affe |
| 86 | 86 |
* [volume_inspect](volume_inspect.md) |
| 87 | 87 |
* [volume_ls](volume_ls.md) |
| 88 | 88 |
* [volume_rm](volume_rm.md) |
| 89 |
+ |
|
| 90 |
+### Swarm node commands |
|
| 91 |
+ |
|
| 92 |
+* [node_accept](node_accept.md) |
|
| 93 |
+* [node_reject](node_reject.md) |
|
| 94 |
+* [node_promote](node_promote.md) |
|
| 95 |
+* [node_demote](node_demote.md) |
|
| 96 |
+* [node_inspect](node_inspect.md) |
|
| 97 |
+* [node_update](node_update.md) |
|
| 98 |
+* [node_tasks](node_tasks.md) |
|
| 99 |
+* [node_ls](node_ls.md) |
|
| 100 |
+* [node_rm](node_rm.md) |
|
| 101 |
+ |
|
| 102 |
+### Swarm swarm commands |
|
| 103 |
+ |
|
| 104 |
+* [swarm init](swarm_init.md) |
|
| 105 |
+* [swarm join](swarm_join.md) |
|
| 106 |
+* [swarm leave](swarm_leave.md) |
|
| 107 |
+* [swarm update](swarm_update.md) |
|
| 108 |
+ |
| ... | ... |
@@ -37,7 +37,7 @@ available on the volume where `/var/lib/docker` is mounted. |
| 37 | 37 |
## Display Docker system information |
| 38 | 38 |
|
| 39 | 39 |
Here is a sample output for a daemon running on Ubuntu, using the overlay |
| 40 |
-storage driver: |
|
| 40 |
+storage driver and a node that is part of a 2 node Swarm cluster: |
|
| 41 | 41 |
|
| 42 | 42 |
$ docker -D info |
| 43 | 43 |
Containers: 14 |
| ... | ... |
@@ -53,6 +53,11 @@ storage driver: |
| 53 | 53 |
Plugins: |
| 54 | 54 |
Volume: local |
| 55 | 55 |
Network: bridge null host |
| 56 |
+ Swarm: |
|
| 57 |
+ NodeID: 0gac67oclbxq7 |
|
| 58 |
+ IsManager: YES |
|
| 59 |
+ Managers: 2 |
|
| 60 |
+ Nodes: 2 |
|
| 56 | 61 |
Kernel Version: 4.4.0-21-generic |
| 57 | 62 |
Operating System: Ubuntu 16.04 LTS |
| 58 | 63 |
OSType: linux |
| ... | ... |
@@ -10,15 +10,15 @@ parent = "smn_cli" |
| 10 | 10 |
|
| 11 | 11 |
# inspect |
| 12 | 12 |
|
| 13 |
- Usage: docker inspect [OPTIONS] CONTAINER|IMAGE [CONTAINER|IMAGE...] |
|
| 13 |
+ Usage: docker inspect [OPTIONS] CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...] |
|
| 14 | 14 |
|
| 15 |
- Return low-level information on a container or image |
|
| 15 |
+ Return low-level information on a container or image or task |
|
| 16 | 16 |
|
| 17 |
- -f, --format="" Format the output using the given go template |
|
| 18 |
- --help Print usage |
|
| 19 |
- --type=container|image Return JSON for specified type, permissible |
|
| 20 |
- values are "image" or "container" |
|
| 21 |
- -s, --size Display total file sizes if the type is container |
|
| 17 |
+ -f, --format="" Format the output using the given go template |
|
| 18 |
+ --help Print usage |
|
| 19 |
+ --type=container|image|task Return JSON for specified type, permissible |
|
| 20 |
+ values are "image" or "container" or "task" |
|
| 21 |
+ -s, --size Display total file sizes if the type is container |
|
| 22 | 22 |
|
| 23 | 23 |
By default, this will render all results in a JSON array. If the container and |
| 24 | 24 |
image have the same name, this will return container JSON for unspecified type. |
| ... | ... |
@@ -47,6 +47,10 @@ straightforward manner. |
| 47 | 47 |
|
| 48 | 48 |
$ docker inspect --format='{{.LogPath}}' $INSTANCE_ID
|
| 49 | 49 |
|
| 50 |
+**Get a Task's image name:** |
|
| 51 |
+ |
|
| 52 |
+ $ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID
|
|
| 53 |
+ |
|
| 50 | 54 |
**List All Port Bindings:** |
| 51 | 55 |
|
| 52 | 56 |
One can loop over arrays and maps in the results to produce simple text |
| 53 | 57 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,28 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node accept" |
|
| 2 |
+description = "The node accept command description and usage" |
|
| 3 |
+keywords = ["node, accept"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+# node accept |
|
| 9 |
+ |
|
| 10 |
+ Usage: docker node accept NODE [NODE...] |
|
| 11 |
+ |
|
| 12 |
+ Accept a node in the swarm |
|
| 13 |
+ |
|
| 14 |
+Accept a node into the swarm. This command targets a docker engine that is a manager in the swarm cluster. |
|
| 15 |
+ |
|
| 16 |
+ |
|
| 17 |
+```bash |
|
| 18 |
+$ docker node accept <node name> |
|
| 19 |
+``` |
|
| 20 |
+ |
|
| 21 |
+## Related information |
|
| 22 |
+ |
|
| 23 |
+* [node reject](node_reject.md) |
|
| 24 |
+* [node promote](node_promote.md) |
|
| 25 |
+* [node demote](node_demote.md) |
| 0 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,28 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node demote" |
|
| 2 |
+description = "The node demote command description and usage" |
|
| 3 |
+keywords = ["node, demote"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+# node demote |
|
| 9 |
+ |
|
| 10 |
+ Usage: docker node demote NODE [NODE...] |
|
| 11 |
+ |
|
| 12 |
+ Demote a node as manager in the swarm |
|
| 13 |
+ |
|
| 14 |
+Demotes an existing Manager so that it is no longer a manager. This command targets a docker engine that is a manager in the swarm cluster. |
|
| 15 |
+ |
|
| 16 |
+ |
|
| 17 |
+```bash |
|
| 18 |
+$ docker node demote <node name> |
|
| 19 |
+``` |
|
| 20 |
+ |
|
| 21 |
+## Related information |
|
| 22 |
+ |
|
| 23 |
+* [node accept](node_accept.md) |
|
| 24 |
+* [node reject](node_reject.md) |
|
| 25 |
+* [node promote](node_promote.md) |
| 0 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,108 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node inspect" |
|
| 2 |
+description = "The node inspect command description and usage" |
|
| 3 |
+keywords = ["node, inspect"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# node inspect |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker node inspect [OPTIONS] self|NODE [NODE...] |
|
| 13 |
+ |
|
| 14 |
+ Return low-level information on a volume |
|
| 15 |
+ |
|
| 16 |
+ -f, --format= Format the output using the given go template. |
|
| 17 |
+ --help Print usage |
|
| 18 |
+ -p, --pretty Print the information in a human friendly format. |
|
| 19 |
+ |
|
| 20 |
+Returns information about a node. By default, this command renders all results |
|
| 21 |
+in a JSON array. You can specify an alternate format to execute a |
|
| 22 |
+given template for each result. Go's |
|
| 23 |
+[text/template](http://golang.org/pkg/text/template/) package describes all the |
|
| 24 |
+details of the format. |
|
| 25 |
+ |
|
| 26 |
+Example output: |
|
| 27 |
+ |
|
| 28 |
+ $ docker node inspect swarm-manager |
|
| 29 |
+ [ |
|
| 30 |
+ {
|
|
| 31 |
+ "ID": "0gac67oclbxq7", |
|
| 32 |
+ "Version": {
|
|
| 33 |
+ "Index": 2028 |
|
| 34 |
+ }, |
|
| 35 |
+ "CreatedAt": "2016-06-06T20:49:32.720047494Z", |
|
| 36 |
+ "UpdatedAt": "2016-06-07T00:23:31.207632893Z", |
|
| 37 |
+ "Spec": {
|
|
| 38 |
+ "Role": "MANAGER", |
|
| 39 |
+ "Membership": "ACCEPTED", |
|
| 40 |
+ "Availability": "ACTIVE" |
|
| 41 |
+ }, |
|
| 42 |
+ "Description": {
|
|
| 43 |
+ "Hostname": "swarm-manager", |
|
| 44 |
+ "Platform": {
|
|
| 45 |
+ "Architecture": "x86_64", |
|
| 46 |
+ "OS": "linux" |
|
| 47 |
+ }, |
|
| 48 |
+ "Resources": {
|
|
| 49 |
+ "NanoCPUs": 1000000000, |
|
| 50 |
+ "MemoryBytes": 1044250624 |
|
| 51 |
+ }, |
|
| 52 |
+ "Engine": {
|
|
| 53 |
+ "EngineVersion": "1.12.0", |
|
| 54 |
+ "Labels": {
|
|
| 55 |
+ "provider": "virtualbox" |
|
| 56 |
+ } |
|
| 57 |
+ } |
|
| 58 |
+ }, |
|
| 59 |
+ "Status": {
|
|
| 60 |
+ "State": "READY" |
|
| 61 |
+ }, |
|
| 62 |
+ "Manager": {
|
|
| 63 |
+ "Raft": {
|
|
| 64 |
+ "RaftID": 2143745093569717375, |
|
| 65 |
+ "Addr": "192.168.99.118:4500", |
|
| 66 |
+ "Status": {
|
|
| 67 |
+ "Leader": true, |
|
| 68 |
+ "Reachability": "REACHABLE" |
|
| 69 |
+ } |
|
| 70 |
+ } |
|
| 71 |
+ }, |
|
| 72 |
+ "Attachment": {},
|
|
| 73 |
+ } |
|
| 74 |
+ ] |
|
| 75 |
+ |
|
| 76 |
+ $ docker node inspect --format '{{ .Manager.Raft.Status.Leader }}' self
|
|
| 77 |
+ false |
|
| 78 |
+ |
|
| 79 |
+ $ docker node inspect --pretty self |
|
| 80 |
+ ID: 2otfhz83efcc7 |
|
| 81 |
+ Hostname: ad960a848573 |
|
| 82 |
+ Status: |
|
| 83 |
+ State: Ready |
|
| 84 |
+ Availability: Active |
|
| 85 |
+ Manager Status: |
|
| 86 |
+ Address: 172.17.0.2:2377 |
|
| 87 |
+ Raft status: Reachable |
|
| 88 |
+ Leader: Yes |
|
| 89 |
+ Platform: |
|
| 90 |
+ Operating System: linux |
|
| 91 |
+ Architecture: x86_64 |
|
| 92 |
+ Resources: |
|
| 93 |
+ CPUs: 4 |
|
| 94 |
+ Memory: 7.704 GiB |
|
| 95 |
+ Plugins: |
|
| 96 |
+ Network: overlay, bridge, null, host, overlay |
|
| 97 |
+ Volume: local |
|
| 98 |
+ Engine Version: 1.12.0 |
|
| 99 |
+ |
|
| 100 |
+## Related information |
|
| 101 |
+ |
|
| 102 |
+* [node update](node_update.md) |
|
| 103 |
+* [node tasks](node_tasks.md) |
|
| 104 |
+* [node ls](node_ls.md) |
|
| 105 |
+* [node rm](node_rm.md) |
| 0 | 106 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,89 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node ls" |
|
| 2 |
+description = "The node ls command description and usage" |
|
| 3 |
+keywords = ["node, list"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# node ls |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker node ls [OPTIONS] |
|
| 13 |
+ |
|
| 14 |
+ List nodes in the swarm |
|
| 15 |
+ |
|
| 16 |
+ Aliases: |
|
| 17 |
+ ls, list |
|
| 18 |
+ |
|
| 19 |
+ Options: |
|
| 20 |
+ -f, --filter value Filter output based on conditions provided |
|
| 21 |
+ --help Print usage |
|
| 22 |
+ -q, --quiet Only display IDs |
|
| 23 |
+ |
|
| 24 |
+Lists all the nodes that the Docker Swarm manager knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options. |
|
| 25 |
+ |
|
| 26 |
+Example output: |
|
| 27 |
+ |
|
| 28 |
+ $ docker node ls |
|
| 29 |
+ ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 30 |
+ 0gac67oclbxq swarm-master Ready Active Reachable Yes |
|
| 31 |
+ 0pwvm3ve66q7 swarm-node-02 Ready Active |
|
| 32 |
+ 15xwihgw71aw * swarm-node-01 Ready Active Reachable |
|
| 33 |
+ |
|
| 34 |
+ |
|
| 35 |
+## Filtering |
|
| 36 |
+ |
|
| 37 |
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more |
|
| 38 |
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) |
|
| 39 |
+ |
|
| 40 |
+The currently supported filters are: |
|
| 41 |
+ |
|
| 42 |
+* name |
|
| 43 |
+* id |
|
| 44 |
+* label |
|
| 45 |
+* desired_state |
|
| 46 |
+ |
|
| 47 |
+### name |
|
| 48 |
+ |
|
| 49 |
+The `name` filter matches on all or part of a tasks's name. |
|
| 50 |
+ |
|
| 51 |
+The following filter matches the node with a name equal to `swarm-master` string. |
|
| 52 |
+ |
|
| 53 |
+ $ docker node ls -f name=swarm-master |
|
| 54 |
+ ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 55 |
+ 0gac67oclbxq * swarm-master Ready Active Reachable Yes |
|
| 56 |
+ |
|
| 57 |
+### id |
|
| 58 |
+ |
|
| 59 |
+The `id` filter matches all or part of a node's id. |
|
| 60 |
+ |
|
| 61 |
+ $ docker node ls -f id=0 |
|
| 62 |
+ ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 63 |
+ 0gac67oclbxq * swarm-master Ready Active Reachable Yes |
|
| 64 |
+ 0pwvm3ve66q7 swarm-node-02 Ready Active |
|
| 65 |
+ |
|
| 66 |
+ |
|
| 67 |
+#### label |
|
| 68 |
+ |
|
| 69 |
+The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a |
|
| 70 |
+value. |
|
| 71 |
+ |
|
| 72 |
+The following filter matches nodes with the `usage` label regardless of its value. |
|
| 73 |
+ |
|
| 74 |
+```bash |
|
| 75 |
+$ docker node ls -f "label=foo" |
|
| 76 |
+ID NAME STATUS AVAILABILITY MANAGER STATUS LEADER |
|
| 77 |
+15xwihgw71aw * swarm-node-01 Ready Active Reachable |
|
| 78 |
+``` |
|
| 79 |
+ |
|
| 80 |
+ |
|
| 81 |
+## Related information |
|
| 82 |
+ |
|
| 83 |
+* [node inspect](node_inspect.md) |
|
| 84 |
+* [node update](node_update.md) |
|
| 85 |
+* [node tasks](node_tasks.md) |
|
| 86 |
+* [node rm](node_rm.md) |
| 0 | 87 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,28 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node promote" |
|
| 2 |
+description = "The node promote command description and usage" |
|
| 3 |
+keywords = ["node, promote"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+# node promote |
|
| 9 |
+ |
|
| 10 |
+ Usage: docker node promote NODE [NODE...] |
|
| 11 |
+ |
|
| 12 |
+ Promote a node as manager in the swarm |
|
| 13 |
+ |
|
| 14 |
+Promotes a node that is pending a promotion to manager. This command targets a docker engine that is a manager in the swarm cluster. |
|
| 15 |
+ |
|
| 16 |
+ |
|
| 17 |
+```bash |
|
| 18 |
+$ docker node promote <node name> |
|
| 19 |
+``` |
|
| 20 |
+ |
|
| 21 |
+## Related information |
|
| 22 |
+ |
|
| 23 |
+* [node accept](node_accept.md) |
|
| 24 |
+* [node reject](node_reject.md) |
|
| 25 |
+* [node demote](node_demote.md) |
| 0 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,28 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node reject" |
|
| 2 |
+description = "The node reject command description and usage" |
|
| 3 |
+keywords = ["node, reject"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+# node reject |
|
| 9 |
+ |
|
| 10 |
+ Usage: docker node reject NODE [NODE...] |
|
| 11 |
+ |
|
| 12 |
+ Reject a node from the swarm |
|
| 13 |
+ |
|
| 14 |
+Reject a node from joining the swarm. This command targets a docker engine that is a manager in the swarm cluster. |
|
| 15 |
+ |
|
| 16 |
+ |
|
| 17 |
+```bash |
|
| 18 |
+$ docker node reject <node name> |
|
| 19 |
+``` |
|
| 20 |
+ |
|
| 21 |
+## Related information |
|
| 22 |
+ |
|
| 23 |
+* [node accept](node_accept.md) |
|
| 24 |
+* [node promote](node_promote.md) |
|
| 25 |
+* [node demote](node_demote.md) |
| 0 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,38 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node rm" |
|
| 2 |
+description = "The node rm command description and usage" |
|
| 3 |
+keywords = ["node, remove"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# node rm |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker node rm NODE [NODE...] |
|
| 13 |
+ |
|
| 14 |
+ Remove a node from the swarm |
|
| 15 |
+ |
|
| 16 |
+ Aliases: |
|
| 17 |
+ rm, remove |
|
| 18 |
+ |
|
| 19 |
+ Options: |
|
| 20 |
+ --help Print usage |
|
| 21 |
+ |
|
| 22 |
+Removes nodes that are specified. |
|
| 23 |
+ |
|
| 24 |
+Example output: |
|
| 25 |
+ |
|
| 26 |
+ $ docker node rm swarm-node-02 |
|
| 27 |
+ Node swarm-node-02 removed from Swarm |
|
| 28 |
+ |
|
| 29 |
+ |
|
| 30 |
+## Related information |
|
| 31 |
+ |
|
| 32 |
+* [node inspect](node_inspect.md) |
|
| 33 |
+* [node update](node_update.md) |
|
| 34 |
+* [node tasks](node_tasks.md) |
|
| 35 |
+* [node ls](node_ls.md) |
| 0 | 36 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,94 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node tasks" |
|
| 2 |
+description = "The node tasks command description and usage" |
|
| 3 |
+keywords = ["node, tasks"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# node tasks |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker node tasks [OPTIONS] NODE |
|
| 13 |
+ |
|
| 14 |
+ List tasks running on a node |
|
| 15 |
+ |
|
| 16 |
+ Options: |
|
| 17 |
+ -a, --all Display all instances |
|
| 18 |
+ -f, --filter value Filter output based on conditions provided |
|
| 19 |
+ --help Print usage |
|
| 20 |
+ -n, --no-resolve Do not map IDs to Names |
|
| 21 |
+ |
|
| 22 |
+Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options. |
|
| 23 |
+ |
|
| 24 |
+Example output: |
|
| 25 |
+ |
|
| 26 |
+ $ docker node tasks swarm-master |
|
| 27 |
+ ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE |
|
| 28 |
+ dx2g0fe3zsdb6y6q453f8dqw2 redis.1 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 29 |
+ f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 30 |
+ 5v26yzixl3one3ptjyqqbd0ro redis.5 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 31 |
+ adcaphlhsfr30d47lby6walg6 redis.8 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 32 |
+ chancjvk9tex6768uzzacslq2 redis.9 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 33 |
+ |
|
| 34 |
+ |
|
| 35 |
+## Filtering |
|
| 36 |
+ |
|
| 37 |
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more |
|
| 38 |
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) |
|
| 39 |
+ |
|
| 40 |
+The currently supported filters are: |
|
| 41 |
+ |
|
| 42 |
+* name |
|
| 43 |
+* id |
|
| 44 |
+* label |
|
| 45 |
+* desired_state |
|
| 46 |
+ |
|
| 47 |
+### name |
|
| 48 |
+ |
|
| 49 |
+The `name` filter matches on all or part of a task's name. |
|
| 50 |
+ |
|
| 51 |
+The following filter matches all tasks with a name containing the `redis` string. |
|
| 52 |
+ |
|
| 53 |
+ $ docker node tasks -f name=redis swarm-master |
|
| 54 |
+ ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE |
|
| 55 |
+ dx2g0fe3zsdb6y6q453f8dqw2 redis.1 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 56 |
+ f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 57 |
+ 5v26yzixl3one3ptjyqqbd0ro redis.5 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 58 |
+ adcaphlhsfr30d47lby6walg6 redis.8 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 59 |
+ chancjvk9tex6768uzzacslq2 redis.9 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 60 |
+ |
|
| 61 |
+ |
|
| 62 |
+### id |
|
| 63 |
+ |
|
| 64 |
+The `id` filter matches a task's id. |
|
| 65 |
+ |
|
| 66 |
+ $ docker node tasks -f id=f33pcf8lwhs4c1t4kq8szwzta swarm-master |
|
| 67 |
+ ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE |
|
| 68 |
+ f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 69 |
+ |
|
| 70 |
+ |
|
| 71 |
+#### label |
|
| 72 |
+ |
|
| 73 |
+The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a |
|
| 74 |
+value. |
|
| 75 |
+ |
|
| 76 |
+The following filter matches tasks with the `usage` label regardless of its value. |
|
| 77 |
+ |
|
| 78 |
+```bash |
|
| 79 |
+$ docker node tasks -f "label=usage" |
|
| 80 |
+ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE |
|
| 81 |
+dx2g0fe3zsdb6y6q453f8dqw2 redis.1 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 82 |
+f33pcf8lwhs4c1t4kq8szwzta redis.4 redis redis:3.0.6 RUNNING RUNNING 2 hours swarm-master |
|
| 83 |
+``` |
|
| 84 |
+ |
|
| 85 |
+ |
|
| 86 |
+## Related information |
|
| 87 |
+ |
|
| 88 |
+* [node inspect](node_inspect.md) |
|
| 89 |
+* [node update](node_update.md) |
|
| 90 |
+* [node ls](node_ls.md) |
|
| 91 |
+* [node rm](node_rm.md) |
| 0 | 92 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,26 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "node update" |
|
| 2 |
+description = "The node update command description and usage" |
|
| 3 |
+keywords = ["resources, update, dynamically"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+## update |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker node update [OPTIONS] Node |
|
| 13 |
+ |
|
| 14 |
+ Update a node |
|
| 15 |
+ |
|
| 16 |
+ |
|
| 17 |
+ |
|
| 18 |
+## Related information |
|
| 19 |
+ |
|
| 20 |
+* [node inspect](node_inspect.md) |
|
| 21 |
+* [node tasks](node_tasks.md) |
|
| 22 |
+* [node ls](node_ls.md) |
|
| 23 |
+* [node rm](node_rm.md) |
| 0 | 24 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,69 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "swarm init" |
|
| 2 |
+description = "The swarm init command description and usage" |
|
| 3 |
+keywords = ["swarm, init"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# swarm init |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker swarm init [OPTIONS] |
|
| 13 |
+ |
|
| 14 |
+ Initialize a Swarm. |
|
| 15 |
+ |
|
| 16 |
+ Options: |
|
| 17 |
+ --auto-accept value Acceptance policy (default [worker,manager]) |
|
| 18 |
+ --force-new-cluster Force create a new cluster from current state. |
|
| 19 |
+ --help Print usage |
|
| 20 |
+ --listen-addr value Listen address (default 0.0.0.0:2377) |
|
| 21 |
+ --secret string Set secret value needed to accept nodes into cluster |
|
| 22 |
+ |
|
| 23 |
+Initialize a Swarm cluster. The docker engine targeted by this command becomes a manager |
|
| 24 |
+in the newly created one node Swarm cluster. |
|
| 25 |
+ |
|
| 26 |
+ |
|
| 27 |
+```bash |
|
| 28 |
+$ docker swarm init --listen-addr 192.168.99.121:2377 |
|
| 29 |
+Initializing a new swarm |
|
| 30 |
+$ docker node ls |
|
| 31 |
+ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER |
|
| 32 |
+3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes |
|
| 33 |
+``` |
|
| 34 |
+ |
|
| 35 |
+### --auto-accept value |
|
| 36 |
+ |
|
| 37 |
+This flag controls node acceptance into the cluster. By default, both `worker` and `manager` |
|
| 38 |
+nodes are auto accepted by the cluster. This can be changed by specifing what kinds of nodes |
|
| 39 |
+can be auto-accepted into the cluster. If auto-accept is not turned on, then |
|
| 40 |
+[node accept](node_accept.md) can be used to explicitly accept a node into the cluster. |
|
| 41 |
+ |
|
| 42 |
+For example, the following initializes a cluster with auto-acceptance of workers, but not managers |
|
| 43 |
+ |
|
| 44 |
+ |
|
| 45 |
+```bash |
|
| 46 |
+$ docker swarm init --listen-addr 192.168.99.121:2377 --auto-accept worker |
|
| 47 |
+Initializing a new swarm |
|
| 48 |
+``` |
|
| 49 |
+ |
|
| 50 |
+### `--force-new-cluster` |
|
| 51 |
+ |
|
| 52 |
+This flag forces an existing node that was part of a quorum that was lost to restart as a single node Manager without losing its data |
|
| 53 |
+ |
|
| 54 |
+### `--listen-addr value` |
|
| 55 |
+ |
|
| 56 |
+The node listens for inbound Swarm manager traffic on this IP:PORT |
|
| 57 |
+ |
|
| 58 |
+### `--secret string` |
|
| 59 |
+ |
|
| 60 |
+Secret value needed to accept nodes into the Swarm |
|
| 61 |
+ |
|
| 62 |
+## Related information |
|
| 63 |
+ |
|
| 64 |
+* [swarm join](swarm_join.md) |
|
| 65 |
+* [swarm leave](swarm_leave.md) |
|
| 66 |
+* [swarm update](swarm_update.md) |
| 0 | 67 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,68 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "swarm join" |
|
| 2 |
+description = "The swarm join command description and usage" |
|
| 3 |
+keywords = ["swarm, join"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# swarm join |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker swarm join [OPTIONS] HOST:PORT |
|
| 13 |
+ |
|
| 14 |
+ Join a Swarm as a node and/or manager. |
|
| 15 |
+ |
|
| 16 |
+ Options: |
|
| 17 |
+ --help Print usage |
|
| 18 |
+ --listen-addr value Listen address (default 0.0.0.0:2377) |
|
| 19 |
+ --manager Try joining as a manager. |
|
| 20 |
+ --secret string Secret for node acceptance |
|
| 21 |
+ |
|
| 22 |
+Join a node to a Swarm cluster. If the `--manager` flag is specified, the docker engine |
|
| 23 |
+targeted by this command becomes a `manager`. If it is not specified, it becomes a `worker`. |
|
| 24 |
+ |
|
| 25 |
+### Join a node to swarm as a manager |
|
| 26 |
+ |
|
| 27 |
+```bash |
|
| 28 |
+$ docker swarm join --manager --listen-addr 192.168.99.122:2377 192.168.99.121:2377 |
|
| 29 |
+This node is attempting to join a Swarm as a manager. |
|
| 30 |
+$ docker node ls |
|
| 31 |
+ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER |
|
| 32 |
+2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE |
|
| 33 |
+3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes |
|
| 34 |
+``` |
|
| 35 |
+ |
|
| 36 |
+### Join a node to swarm as a worker |
|
| 37 |
+ |
|
| 38 |
+```bash |
|
| 39 |
+$ docker swarm join --listen-addr 192.168.99.123:2377 192.168.99.121:2377 |
|
| 40 |
+This node is attempting to join a Swarm. |
|
| 41 |
+$ docker node ls |
|
| 42 |
+ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER |
|
| 43 |
+04zm7ue1fd1q swarm-node-02 READY ACTIVE |
|
| 44 |
+2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE |
|
| 45 |
+3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes |
|
| 46 |
+``` |
|
| 47 |
+ |
|
| 48 |
+### `--manager` |
|
| 49 |
+ |
|
| 50 |
+Joins the node as a manager |
|
| 51 |
+ |
|
| 52 |
+### `--listen-addr value` |
|
| 53 |
+ |
|
| 54 |
+The node listens for inbound Swarm manager traffic on this IP:PORT |
|
| 55 |
+ |
|
| 56 |
+### `--secret string` |
|
| 57 |
+ |
|
| 58 |
+Secret value required for nodes to join the swarm |
|
| 59 |
+ |
|
| 60 |
+ |
|
| 61 |
+## Related information |
|
| 62 |
+ |
|
| 63 |
+* [swarm init](swarm_init.md) |
|
| 64 |
+* [swarm leave](swarm_leave.md) |
|
| 65 |
+* [swarm update](swarm_update.md) |
| 0 | 66 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,52 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "swarm leave" |
|
| 2 |
+description = "The swarm leave command description and usage" |
|
| 3 |
+keywords = ["swarm, leave"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# swarm leave |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker swarm leave |
|
| 13 |
+ |
|
| 14 |
+ Leave a Swarm swarm. |
|
| 15 |
+ |
|
| 16 |
+ Options: |
|
| 17 |
+ --help Print usage |
|
| 18 |
+ |
|
| 19 |
+This command causes the node to leave the swarm. |
|
| 20 |
+ |
|
| 21 |
+On a manager node: |
|
| 22 |
+```bash |
|
| 23 |
+$ docker node ls |
|
| 24 |
+ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER |
|
| 25 |
+04zm7ue1fd1q swarm-node-02 READY ACTIVE |
|
| 26 |
+2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE |
|
| 27 |
+3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes |
|
| 28 |
+``` |
|
| 29 |
+ |
|
| 30 |
+On a worker node: |
|
| 31 |
+```bash |
|
| 32 |
+$ docker swarm leave |
|
| 33 |
+Node left the default swarm. |
|
| 34 |
+``` |
|
| 35 |
+ |
|
| 36 |
+On a manager node: |
|
| 37 |
+```bash |
|
| 38 |
+$ docker node ls |
|
| 39 |
+ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER |
|
| 40 |
+04zm7ue1fd1q swarm-node-02 DOWN ACTIVE |
|
| 41 |
+2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE |
|
| 42 |
+3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes |
|
| 43 |
+``` |
|
| 44 |
+ |
|
| 45 |
+## Related information |
|
| 46 |
+ |
|
| 47 |
+* [swarm init](swarm_init.md) |
|
| 48 |
+* [swarm join](swarm_join.md) |
|
| 49 |
+* [swarm update](swarm_update.md) |
| 0 | 50 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,37 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+title = "swarm update" |
|
| 2 |
+description = "The swarm update command description and usage" |
|
| 3 |
+keywords = ["swarm, update"] |
|
| 4 |
+[menu.main] |
|
| 5 |
+parent = "smn_cli" |
|
| 6 |
+<![end-metadata]--> |
|
| 7 |
+ |
|
| 8 |
+**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. |
|
| 9 |
+ |
|
| 10 |
+# swarm update |
|
| 11 |
+ |
|
| 12 |
+ Usage: docker swarm update [OPTIONS] |
|
| 13 |
+ |
|
| 14 |
+ update the Swarm. |
|
| 15 |
+ |
|
| 16 |
+ Options: |
|
| 17 |
+ --auto-accept value Acceptance policy (default [worker,manager]) |
|
| 18 |
+ --help Print usage |
|
| 19 |
+ --secret string Set secret value needed to accept nodes into cluster |
|
| 20 |
+ |
|
| 21 |
+ |
|
| 22 |
+Updates a Swarm cluster with new parameter values. This command must target a manager node. |
|
| 23 |
+ |
|
| 24 |
+ |
|
| 25 |
+```bash |
|
| 26 |
+$ docker swarm update --auto-accept manager |
|
| 27 |
+``` |
|
| 28 |
+ |
|
| 29 |
+## Related information |
|
| 30 |
+ |
|
| 31 |
+* [swarm init](swarm_init.md) |
|
| 32 |
+* [swarm join](swarm_join.md) |
|
| 33 |
+* [swarm leave](swarm_leave.md) |
|
| 34 |
+ |