Browse code

Update docs for `service ps`

This fix updates docs for `service ps` as now the TASK ID part has been
removed.

Also, this fix fixes several incorrect sample output.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

Yong Tang authored on 2016/09/28 11:12:48
Showing 7 changed files
... ...
@@ -29,12 +29,12 @@ Lists all the tasks on a Node that Docker knows about. You can filter using the
29 29
 Example output:
30 30
 
31 31
     $ docker node ps swarm-manager1
32
-    ID                         NAME      SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
33
-    7q92v0nr1hcgts2amcjyqg3pq  redis.1   redis    redis:3.0.6  Running 5 hours     Running        swarm-manager1
34
-    b465edgho06e318egmgjbqo4o  redis.6   redis    redis:3.0.6  Running 29 seconds  Running        swarm-manager1
35
-    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
36
-    dkkual96p4bb3s6b10r7coxxt  redis.9   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
37
-    0tgctg8h8cech4w0k0gwrmr23  redis.10  redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
32
+    NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
33
+    redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
34
+    redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
35
+    redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
36
+    redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
37
+    redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
38 38
 
39 39
 
40 40
 ## Filtering
... ...
@@ -56,12 +56,12 @@ The `name` filter matches on all or part of a task's name.
56 56
 The following filter matches all tasks with a name containing the `redis` string.
57 57
 
58 58
     $ docker node ps -f name=redis swarm-manager1
59
-    ID                         NAME      SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
60
-    7q92v0nr1hcgts2amcjyqg3pq  redis.1   redis    redis:3.0.6  Running 5 hours     Running        swarm-manager1
61
-    b465edgho06e318egmgjbqo4o  redis.6   redis    redis:3.0.6  Running 29 seconds  Running        swarm-manager1
62
-    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
63
-    dkkual96p4bb3s6b10r7coxxt  redis.9   redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
64
-    0tgctg8h8cech4w0k0gwrmr23  redis.10  redis    redis:3.0.6  Running 5 seconds   Running        swarm-manager1
59
+    NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
60
+    redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
61
+    redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
62
+    redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
63
+    redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
64
+    redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
65 65
 
66 66
 
67 67
 #### id
... ...
@@ -69,8 +69,8 @@ The following filter matches all tasks with a name containing the `redis` string
69 69
 The `id` filter matches a task's id.
70 70
 
71 71
     $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
72
-    ID                         NAME      SERVICE  IMAGE        LAST STATE             DESIRED STATE  NODE
73
-    bg8c07zzg87di2mufeq51a2qp  redis.7   redis    redis:3.0.6  Running 5 seconds      Running        swarm-manager1
72
+    NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
73
+    redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
74 74
 
75 75
 
76 76
 #### label
... ...
@@ -82,9 +82,9 @@ The following filter matches tasks with the `usage` label regardless of its valu
82 82
 
83 83
 ```bash
84 84
 $ docker node ps -f "label=usage"
85
-ID                         NAME     SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
86
-b465edgho06e318egmgjbqo4o  redis.6  redis    redis:3.0.6  Running 10 minutes  Running        swarm-manager1
87
-bg8c07zzg87di2mufeq51a2qp  redis.7  redis    redis:3.0.6  Running 9 minutes   Running        swarm-manager1
85
+NAME                               IMAGE        NODE            DESIRED STATE  CURRENT STATE
86
+redis.6.b465edgho06e318egmgjbqo4o  redis:3.0.6  swarm-manager1  Running        Running 10 minutes
87
+redis.7.bg8c07zzg87di2mufeq51a2qp  redis:3.0.6  swarm-manager1  Running        Running 9 minutes
88 88
 ```
89 89
 
90 90
 
... ...
@@ -36,17 +36,17 @@ The following command shows all the tasks that are part of the `redis` service:
36 36
 
37 37
 ```bash
38 38
 $ docker service ps redis
39
-ID                         NAME      SERVICE IMAGE        LAST STATE          DESIRED STATE  NODE
40
-0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis   redis:3.0.6  Running 8 seconds   Running        manager1
41
-bk658fpbex0d57cqcwoe3jthu  redis.2   redis   redis:3.0.6  Running 9 seconds   Running        worker2
42
-5ls5s5fldaqg37s9pwayjecrf  redis.3   redis   redis:3.0.6  Running 9 seconds   Running        worker1
43
-8ryt076polmclyihzx67zsssj  redis.4   redis   redis:3.0.6  Running 9 seconds   Running        worker1
44
-1x0v8yomsncd6sbvfn0ph6ogc  redis.5   redis   redis:3.0.6  Running 8 seconds   Running        manager1
45
-71v7je3el7rrw0osfywzs0lko  redis.6   redis   redis:3.0.6  Running 9 seconds   Running        worker2
46
-4l3zm9b7tfr7cedaik8roxq6r  redis.7   redis   redis:3.0.6  Running 9 seconds   Running        worker2
47
-9tfpyixiy2i74ad9uqmzp1q6o  redis.8   redis   redis:3.0.6  Running 9 seconds   Running        worker1
48
-3w1wu13yuplna8ri3fx47iwad  redis.9   redis   redis:3.0.6  Running 8 seconds   Running        manager1
49
-8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis   redis:3.0.6  Running 8 seconds   Running        manager1
39
+NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
40
+redis.1.0qihejybwf1x5vqi8lgzlgnpq   redis:3.0.6  manager1  Running        Running 8 seconds
41
+redis.2.bk658fpbex0d57cqcwoe3jthu   redis:3.0.6  worker2   Running        Running 9 seconds
42
+redis.3.5ls5s5fldaqg37s9pwayjecrf   redis:3.0.6  worker1   Running        Running 9 seconds
43
+redis.4.8ryt076polmclyihzx67zsssj   redis:3.0.6  worker1   Running        Running 9 seconds
44
+redis.5.1x0v8yomsncd6sbvfn0ph6ogc   redis:3.0.6  manager1  Running        Running 8 seconds
45
+redis.6.71v7je3el7rrw0osfywzs0lko   redis:3.0.6  worker2   Running        Running 9 seconds
46
+redis.7.4l3zm9b7tfr7cedaik8roxq6r   redis:3.0.6  worker2   Running        Running 9 seconds
47
+redis.8.9tfpyixiy2i74ad9uqmzp1q6o   redis:3.0.6  worker1   Running        Running 9 seconds
48
+redis.9.3w1wu13yuplna8ri3fx47iwad   redis:3.0.6  manager1  Running        Running 8 seconds
49
+redis.10.8eaxrb2fqpbnv9x30vr06i6vt  redis:3.0.6  manager1  Running        Running 8 seconds
50 50
 ```
51 51
 
52 52
 
... ...
@@ -70,9 +70,9 @@ The `id` filter matches on all or a prefix of a task's ID.
70 70
 
71 71
 ```bash
72 72
 $ docker service ps -f "id=8" redis
73
-ID                         NAME      SERVICE  IMAGE        LAST STATE         DESIRED STATE  NODE
74
-8ryt076polmclyihzx67zsssj  redis.4   redis    redis:3.0.6  Running 4 minutes  Running        worker1
75
-8eaxrb2fqpbnv9x30vr06i6vt  redis.10  redis    redis:3.0.6  Running 4 minutes  Running        manager1
73
+NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
74
+redis.4.8ryt076polmclyihzx67zsssj   redis:3.0.6  worker1   Running        Running 9 seconds
75
+redis.10.8eaxrb2fqpbnv9x30vr06i6vt  redis:3.0.6  manager1  Running        Running 8 seconds
76 76
 ```
77 77
 
78 78
 #### Name
... ...
@@ -81,8 +81,8 @@ The `name` filter matches on task names.
81 81
 
82 82
 ```bash
83 83
 $ docker service ps -f "name=redis.1" redis
84
-ID                         NAME      SERVICE  IMAGE        DESIRED STATE  LAST STATE         NODE
85
-0qihejybwf1x5vqi8lgzlgnpq  redis.1   redis    redis:3.0.6  Running        Running 8 seconds  manager1
84
+NAME                                IMAGE        NODE      DESIRED STATE  CURRENT STATE
85
+redis.1.0qihejybwf1x5vqi8lgzlgnpq   redis:3.0.6  manager1  Running        Running 8 seconds
86 86
 ```
87 87
 
88 88
 
... ...
@@ -100,10 +100,10 @@ tasks are running for the service:
100 100
 ```bash
101 101
 $ docker service ps my-web
102 102
 
103
-ID                         NAME      IMAGE  NODE   DESIRED STATE  CURRENT STATE               ERROR
104
-63s86gf6a0ms34mvboniev7bs  my-web.1  nginx  node1  Running        Running 58 seconds ago
105
-6b3q2qbjveo4zauc6xig7au10  my-web.2  nginx  node2  Running        Running 58 seconds ago
106
-66u2hcrz0miqpc8h0y0f3v7aw  my-web.3  nginx  node3  Running        Running about a minute ago
103
+NAME                                IMAGE  NODE   DESIRED STATE  CURRENT STATE               ERROR
104
+my-web.1.63s86gf6a0ms34mvboniev7bs  nginx  node1  Running        Running 58 seconds ago
105
+my-web.2.6b3q2qbjveo4zauc6xig7au10  nginx  node2  Running        Running 58 seconds ago
106
+my-web.3.66u2hcrz0miqpc8h0y0f3v7aw  nginx  node3  Running        Running about a minute ago
107 107
 ```
108 108
 
109 109
 ![service vip image](images/service-vip.png)
... ...
@@ -200,8 +200,8 @@ using the DNS name `my-web`:
200 200
     ```bash
201 201
     $ docker service ps my-busybox
202 202
 
203
-    ID                         NAME          IMAGE    NODE   DESIRED STATE  CURRENT STATE          ERROR
204
-    1dok2cmx2mln5hbqve8ilnair  my-busybox.1  busybox  node1  Running        Running 5 seconds ago
203
+    NAME                                    IMAGE    NODE   DESIRED STATE  CURRENT STATE          ERROR
204
+    my-busybox.1.1dok2cmx2mln5hbqve8ilnair  busybox  node1  Running        Running 5 seconds ago
205 205
     ```
206 206
 
207 207
 3. From the node where the busybox task is running, open an interactive shell to
... ...
@@ -51,10 +51,10 @@ tasks to different nodes:
51 51
     ```bash
52 52
     $ docker service ps redis
53 53
 
54
-    ID                         NAME     SERVICE  IMAGE        LAST STATE          DESIRED STATE  NODE
55
-    7q92v0nr1hcgts2amcjyqg3pq  redis.1  redis    redis:3.0.6  Running 26 seconds  Running        manager1
56
-    7h2l8h3q3wqy5f66hlv9ddmi6  redis.2  redis    redis:3.0.6  Running 26 seconds  Running        worker1
57
-    9bg7cezvedmkgg6c8yzvbhwsd  redis.3  redis    redis:3.0.6  Running 26 seconds  Running        worker2
54
+    NAME                               IMAGE        NODE     DESIRED STATE  CURRENT STATE
55
+    redis.1.7q92v0nr1hcgts2amcjyqg3pq  redis:3.0.6  manager1 Running        Running 26 seconds
56
+    redis.2.7h2l8h3q3wqy5f66hlv9ddmi6  redis:3.0.6  worker1  Running        Running 26 seconds
57
+    redis.3.9bg7cezvedmkgg6c8yzvbhwsd  redis:3.0.6  worker2  Running        Running 26 seconds
58 58
     ```
59 59
 
60 60
     In this case the swarm manager distributed one task to each node. You may
... ...
@@ -90,11 +90,11 @@ task assignments for the `redis` service:
90 90
     ```bash
91 91
     $ docker service ps redis
92 92
 
93
-    ID                         NAME          IMAGE        NODE      DESIRED STATE  CURRENT STATE           ERROR
94
-    7q92v0nr1hcgts2amcjyqg3pq  redis.1       redis:3.0.6  manager1  Running        Running 4 minutes
95
-    b4hovzed7id8irg1to42egue8  redis.2       redis:3.0.6  worker2   Running        Running About a minute
96
-    7h2l8h3q3wqy5f66hlv9ddmi6   \_ redis.2   redis:3.0.6  worker1   Shutdown       Shutdown 2 minutes ago
97
-    9bg7cezvedmkgg6c8yzvbhwsd  redis.3       redis:3.0.6  worker2   Running        Running 4 minutes
93
+    NAME                                    IMAGE        NODE      DESIRED STATE  CURRENT STATE           ERROR
94
+    redis.1.7q92v0nr1hcgts2amcjyqg3pq       redis:3.0.6  manager1  Running        Running 4 minutes
95
+    redis.2.b4hovzed7id8irg1to42egue8       redis:3.0.6  worker2   Running        Running About a minute
96
+     \_ redis.2.7h2l8h3q3wqy5f66hlv9ddmi6   redis:3.0.6  worker1   Shutdown       Shutdown 2 minutes ago
97
+    redis.3.9bg7cezvedmkgg6c8yzvbhwsd       redis:3.0.6  worker2   Running        Running 4 minutes
98 98
     ```
99 99
 
100 100
     The swarm manager maintains the desired state by ending the task on a node
... ...
@@ -97,8 +97,8 @@ service:
97 97
     ```
98 98
     $ docker service ps helloworld
99 99
 
100
-    ID                         NAME          SERVICE     IMAGE   LAST STATE         DESIRED STATE  NODE
101
-    8p1vev3fq5zm0mi8g0as41w35  helloworld.1  helloworld  alpine  Running 3 minutes  Running        worker2
100
+    NAME                                    IMAGE   NODE     DESIRED STATE  LAST STATE
101
+    helloworld.1.8p1vev3fq5zm0mi8g0as41w35  alpine  worker2  Running        Running 3 minutes
102 102
     ```
103 103
 
104 104
     In this case, the one instance of the `helloworld` service is running on the
... ...
@@ -138,13 +138,13 @@ desired state:
138 138
     ```bash
139 139
     $ docker service ps redis
140 140
 
141
-    ID                         NAME         IMAGE        NODE       DESIRED STATE  CURRENT STATE            ERROR
142
-    dos1zffgeofhagnve8w864fco  redis.1      redis:3.0.7  worker1    Running        Running 37 seconds
143
-    88rdo6pa52ki8oqx6dogf04fh   \_ redis.1  redis:3.0.6  worker2    Shutdown       Shutdown 56 seconds ago
144
-    9l3i4j85517skba5o7tn5m8g0  redis.2      redis:3.0.7  worker2    Running        Running About a minute
145
-    66k185wilg8ele7ntu8f6nj6i   \_ redis.2  redis:3.0.6  worker1    Shutdown       Shutdown 2 minutes ago
146
-    egiuiqpzrdbxks3wxgn8qib1g  redis.3      redis:3.0.7  worker1    Running        Running 48 seconds
147
-    ctzktfddb2tepkr45qcmqln04   \_ redis.3  redis:3.0.6  mmanager1  Shutdown       Shutdown 2 minutes ago
141
+    NAME                                   IMAGE        NODE       DESIRED STATE  CURRENT STATE            ERROR
142
+    redis.1.dos1zffgeofhagnve8w864fco      redis:3.0.7  worker1    Running        Running 37 seconds
143
+     \_ redis.1.88rdo6pa52ki8oqx6dogf04fh  redis:3.0.6  worker2    Shutdown       Shutdown 56 seconds ago
144
+    redis.2.9l3i4j85517skba5o7tn5m8g0      redis:3.0.7  worker2    Running        Running About a minute
145
+     \_ redis.2.66k185wilg8ele7ntu8f6nj6i  redis:3.0.6  worker1    Shutdown       Shutdown 2 minutes ago
146
+    redis.3.egiuiqpzrdbxks3wxgn8qib1g      redis:3.0.7  worker1    Running        Running 48 seconds
147
+     \_ redis.3.ctzktfddb2tepkr45qcmqln04  redis:3.0.6  mmanager1  Shutdown       Shutdown 2 minutes ago
148 148
     ```
149 149
 
150 150
     Before Swarm updates all of the tasks, you can see that some are running
... ...
@@ -40,12 +40,12 @@ service running in the swarm:
40 40
     ```
41 41
     $ docker service ps helloworld
42 42
 
43
-    ID                         NAME          SERVICE     IMAGE   LAST STATE          DESIRED STATE  NODE
44
-    8p1vev3fq5zm0mi8g0as41w35  helloworld.1  helloworld  alpine  Running 7 minutes   Running        worker2
45
-    c7a7tcdq5s0uk3qr88mf8xco6  helloworld.2  helloworld  alpine  Running 24 seconds  Running        worker1
46
-    6crl09vdcalvtfehfh69ogfb1  helloworld.3  helloworld  alpine  Running 24 seconds  Running        worker1
47
-    auky6trawmdlcne8ad8phb0f1  helloworld.4  helloworld  alpine  Running 24 seconds  Accepted       manager1
48
-    ba19kca06l18zujfwxyc5lkyn  helloworld.5  helloworld  alpine  Running 24 seconds  Running        worker2
43
+    NAME                                    IMAGE   NODE      DESIRED STATE  CURRENT STATE
44
+    helloworld.1.8p1vev3fq5zm0mi8g0as41w35  alpine  worker2   Running        Running 7 minutes
45
+    helloworld.2.c7a7tcdq5s0uk3qr88mf8xco6  alpine  worker1   Running        Running 24 seconds
46
+    helloworld.3.6crl09vdcalvtfehfh69ogfb1  alpine  worker1   Running        Running 24 seconds
47
+    helloworld.4.auky6trawmdlcne8ad8phb0f1  alpine  manager1  Running        Running 24 seconds
48
+    helloworld.5.ba19kca06l18zujfwxyc5lkyn  alpine  worker2   Running        Running 24 seconds
49 49
     ```
50 50
 
51 51
     You can see that swarm has created 4 new tasks to scale to a total of 5