Signed-off-by: Alicia Lauerman <alicia@eta.im>
| ... | ... |
@@ -3,7 +3,6 @@ package service |
| 3 | 3 |
import ( |
| 4 | 4 |
"fmt" |
| 5 | 5 |
"io" |
| 6 |
- "strings" |
|
| 7 | 6 |
"text/tabwriter" |
| 8 | 7 |
|
| 9 | 8 |
"github.com/docker/docker/api/types" |
| ... | ... |
@@ -18,7 +17,7 @@ import ( |
| 18 | 18 |
) |
| 19 | 19 |
|
| 20 | 20 |
const ( |
| 21 |
- listItemFmt = "%s\t%s\t%s\t%s\t%s\n" |
|
| 21 |
+ listItemFmt = "%s\t%s\t%s\t%s\n" |
|
| 22 | 22 |
) |
| 23 | 23 |
|
| 24 | 24 |
type listOptions struct {
|
| ... | ... |
@@ -110,7 +109,7 @@ func printTable(out io.Writer, services []swarm.Service, running map[string]int) |
| 110 | 110 |
// Ignore flushing errors |
| 111 | 111 |
defer writer.Flush() |
| 112 | 112 |
|
| 113 |
- fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE", "COMMAND") |
|
| 113 |
+ fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE") |
|
| 114 | 114 |
for _, service := range services {
|
| 115 | 115 |
replicas := "" |
| 116 | 116 |
if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {
|
| ... | ... |
@@ -124,8 +123,7 @@ func printTable(out io.Writer, services []swarm.Service, running map[string]int) |
| 124 | 124 |
stringid.TruncateID(service.ID), |
| 125 | 125 |
service.Spec.Name, |
| 126 | 126 |
replicas, |
| 127 |
- service.Spec.TaskTemplate.ContainerSpec.Image, |
|
| 128 |
- strings.Join(service.Spec.TaskTemplate.ContainerSpec.Args, " ")) |
|
| 127 |
+ service.Spec.TaskTemplate.ContainerSpec.Image) |
|
| 129 | 128 |
} |
| 130 | 129 |
} |
| 131 | 130 |
|
| ... | ... |
@@ -73,7 +73,7 @@ $ docker service create --name redis redis:3.0.6 |
| 73 | 73 |
dmu1ept4cxcfe8k8lhtux3ro3 |
| 74 | 74 |
|
| 75 | 75 |
$ docker service ls |
| 76 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 76 |
+ID NAME REPLICAS IMAGE |
|
| 77 | 77 |
dmu1ept4cxcf redis 1/1 redis:3.0.6 |
| 78 | 78 |
``` |
| 79 | 79 |
|
| ... | ... |
@@ -97,7 +97,7 @@ number of `RUNNING` tasks is `3`: |
| 97 | 97 |
|
| 98 | 98 |
```bash |
| 99 | 99 |
$ docker service ls |
| 100 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 100 |
+ID NAME REPLICAS IMAGE |
|
| 101 | 101 |
4cdgfyky7ozw redis 3/5 redis:3.0.7 |
| 102 | 102 |
``` |
| 103 | 103 |
|
| ... | ... |
@@ -106,7 +106,7 @@ equal to the desired number: |
| 106 | 106 |
|
| 107 | 107 |
```bash |
| 108 | 108 |
$ docker service ls |
| 109 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 109 |
+ID NAME REPLICAS IMAGE |
|
| 110 | 110 |
4cdgfyky7ozw redis 5/5 redis:3.0.7 |
| 111 | 111 |
``` |
| 112 | 112 |
|
| ... | ... |
@@ -34,7 +34,7 @@ swarm. |
| 34 | 34 |
|
| 35 | 35 |
On a manager node: |
| 36 | 36 |
```bash |
| 37 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 37 |
+ID NAME REPLICAS IMAGE |
|
| 38 | 38 |
c8wgl7q4ndfd frontend 5/5 nginx:alpine |
| 39 | 39 |
dmu1ept4cxcf redis 3/3 redis:3.0.6 |
| 40 | 40 |
``` |
| ... | ... |
@@ -60,7 +60,7 @@ The `id` filter matches all or part of a service's id. |
| 60 | 60 |
|
| 61 | 61 |
```bash |
| 62 | 62 |
$ docker service ls -f "id=0bcjw" |
| 63 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 63 |
+ID NAME REPLICAS IMAGE |
|
| 64 | 64 |
0bcjwfh8ychr redis 1/1 redis:3.0.6 |
| 65 | 65 |
``` |
| 66 | 66 |
|
| ... | ... |
@@ -74,7 +74,7 @@ its value: |
| 74 | 74 |
|
| 75 | 75 |
```bash |
| 76 | 76 |
$ docker service ls --filter label=project |
| 77 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 77 |
+ID NAME REPLICAS IMAGE |
|
| 78 | 78 |
01sl1rp6nj5u frontend2 1/1 nginx:alpine |
| 79 | 79 |
36xvvwwauej0 frontend 5/5 nginx:alpine |
| 80 | 80 |
74nzcxxjv6fq backend 3/3 redis:3.0.6 |
| ... | ... |
@@ -85,7 +85,7 @@ The following filter matches only services with the `project` label with the |
| 85 | 85 |
|
| 86 | 86 |
```bash |
| 87 | 87 |
$ docker service ls --filter label=project=project-a |
| 88 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 88 |
+ID NAME REPLICAS IMAGE |
|
| 89 | 89 |
36xvvwwauej0 frontend 5/5 nginx:alpine |
| 90 | 90 |
74nzcxxjv6fq backend 3/3 redis:3.0.6 |
| 91 | 91 |
``` |
| ... | ... |
@@ -99,7 +99,7 @@ The following filter matches services with a name containing `redis`. |
| 99 | 99 |
|
| 100 | 100 |
```bash |
| 101 | 101 |
$ docker service ls --filter name=redis |
| 102 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 102 |
+ID NAME REPLICAS IMAGE |
|
| 103 | 103 |
0bcjwfh8ychr redis 1/1 redis:3.0.6 |
| 104 | 104 |
``` |
| 105 | 105 |
|
| ... | ... |
@@ -28,8 +28,8 @@ Options: |
| 28 | 28 |
|
| 29 | 29 |
### Scale a service |
| 30 | 30 |
|
| 31 |
-The scale command enables you to scale one or more replicated services either up |
|
| 32 |
-or down to the desired number of replicas. This command cannot be applied on |
|
| 31 |
+The scale command enables you to scale one or more replicated services either up |
|
| 32 |
+or down to the desired number of replicas. This command cannot be applied on |
|
| 33 | 33 |
services which are global mode. The command will return immediately, but the |
| 34 | 34 |
actual scaling of the service may take some time. To stop all replicas of a |
| 35 | 35 |
service while keeping the service active in the swarm you can set the scale to 0. |
| ... | ... |
@@ -56,7 +56,7 @@ replicas. |
| 56 | 56 |
```bash |
| 57 | 57 |
$ docker service ls --filter name=frontend |
| 58 | 58 |
|
| 59 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 59 |
+ID NAME REPLICAS IMAGE |
|
| 60 | 60 |
3pr5mlvu3fh9 frontend 15/50 nginx:alpine |
| 61 | 61 |
``` |
| 62 | 62 |
|
| ... | ... |
@@ -80,7 +80,7 @@ backend scaled to 3 |
| 80 | 80 |
frontend scaled to 5 |
| 81 | 81 |
|
| 82 | 82 |
$ docker service ls |
| 83 |
-ID NAME REPLICAS IMAGE COMMAND |
|
| 83 |
+ID NAME REPLICAS IMAGE |
|
| 84 | 84 |
3pr5mlvu3fh9 frontend 5/5 nginx:alpine |
| 85 | 85 |
74nzcxxjv6fq backend 3/3 redis:3.0.6 |
| 86 | 86 |
``` |