Browse code

Merge pull request #30804 from mstanleyjones/cli_fixups

Cli fixups
(cherry picked from commit 40dbbd3f9b631a0745e596072675729018378a75)

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

Sebastiaan van Stijn authored on 2017/02/09 10:07:43
Showing 102 changed files
... ...
@@ -27,6 +27,8 @@ Options:
27 27
       --sig-proxy            Proxy all received signals to the process (default true)
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Use `docker attach` to attach to a running container using the container's ID
31 33
 or name, either to view its ongoing output or to control it interactively.
32 34
 You can attach to the same contained process multiple times simultaneously,
... ...
@@ -55,8 +57,7 @@ performance critical applications that generate a lot of output in the
55 55
 foreground over a slow client connection. Instead, users should use the
56 56
 `docker logs` command to get access to the logs.
57 57
 
58
-
59
-## Override the detach sequence
58
+### Override the detach sequence
60 59
 
61 60
 If you want, you can configure an override the Docker key sequence for detach.
62 61
 This is useful if the Docker default sequence conflicts with key sequence you
... ...
@@ -80,52 +81,72 @@ These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key
80 80
 sequences. To configure a different configuration default key sequence for all
81 81
 containers, see [**Configuration file** section](cli.md#configuration-files).
82 82
 
83
-#### Examples
83
+## Examples
84 84
 
85
-    $ docker run -d --name topdemo ubuntu /usr/bin/top -b
86
-    $ docker attach topdemo
87
-    top - 02:05:52 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
88
-    Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
89
-    Cpu(s):  0.1%us,  0.2%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
90
-    Mem:    373572k total,   355560k used,    18012k free,    27872k buffers
91
-    Swap:   786428k total,        0k used,   786428k free,   221740k cached
85
+### Attach to and detach from a running container
92 86
 
93
-    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
94
-     1 root      20   0 17200 1116  912 R    0  0.3   0:00.03 top
87
+```bash
88
+$ docker run -d --name topdemo ubuntu /usr/bin/top -b
95 89
 
96
-     top - 02:05:55 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
97
-     Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
98
-     Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
99
-     Mem:    373572k total,   355244k used,    18328k free,    27872k buffers
100
-     Swap:   786428k total,        0k used,   786428k free,   221776k cached
90
+$ docker attach topdemo
101 91
 
102
-       PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
103
-           1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
92
+top - 02:05:52 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
93
+Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
94
+Cpu(s):  0.1%us,  0.2%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
95
+Mem:    373572k total,   355560k used,    18012k free,    27872k buffers
96
+Swap:   786428k total,        0k used,   786428k free,   221740k cached
104 97
 
98
+PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
99
+ 1 root      20   0 17200 1116  912 R    0  0.3   0:00.03 top
105 100
 
106
-     top - 02:05:58 up  3:06,  0 users,  load average: 0.01, 0.02, 0.05
107
-     Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
108
-     Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
109
-     Mem:    373572k total,   355780k used,    17792k free,    27880k buffers
110
-     Swap:   786428k total,        0k used,   786428k free,   221776k cached
101
+ top - 02:05:55 up  3:05,  0 users,  load average: 0.01, 0.02, 0.05
102
+ Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
103
+ Cpu(s):  0.0%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
104
+ Mem:    373572k total,   355244k used,    18328k free,    27872k buffers
105
+ Swap:   786428k total,        0k used,   786428k free,   221776k cached
111 106
 
112
-     PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
113
-          1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
114
-    ^C$
115
-    $ echo $?
116
-    0
117
-    $ docker ps -a | grep topdemo
118
-    7998ac8581f9        ubuntu:14.04        "/usr/bin/top -b"   38 seconds ago      Exited (0) 21 seconds ago                          topdemo
107
+   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
108
+       1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
109
+
110
+
111
+ top - 02:05:58 up  3:06,  0 users,  load average: 0.01, 0.02, 0.05
112
+ Tasks:   1 total,   1 running,   0 sleeping,   0 stopped,   0 zombie
113
+ Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
114
+ Mem:    373572k total,   355780k used,    17792k free,    27880k buffers
115
+ Swap:   786428k total,        0k used,   786428k free,   221776k cached
116
+
117
+ PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
118
+      1 root      20   0 17208 1144  932 R    0  0.3   0:00.03 top
119
+^C$
120
+
121
+$ echo $?
122
+0
123
+$ docker ps -a | grep topdemo
124
+
125
+7998ac8581f9        ubuntu:14.04        "/usr/bin/top -b"   38 seconds ago      Exited (0) 21 seconds ago                          topdemo
126
+```
127
+
128
+### Get the exit code of the container's command
119 129
 
120 130
 And in this second example, you can see the exit code returned by the `bash`
121 131
 process is returned by the `docker attach` command to its caller too:
122 132
 
133
+```bash
123 134
     $ docker run --name test -d -it debian
135
+
124 136
     275c44472aebd77c926d4527885bb09f2f6db21d878c75f0a1c212c03d3bcfab
137
+
125 138
     $ docker attach test
139
+
126 140
     root@f38c87f2a42d:/# exit 13
141
+
127 142
     exit
143
+
128 144
     $ echo $?
145
+
129 146
     13
147
+
130 148
     $ docker ps -a | grep test
149
+
131 150
     275c44472aeb        debian:7            "/bin/bash"         26 seconds ago      Exited (13) 17 seconds ago                         test
151
+```
... ...
@@ -58,6 +58,8 @@ Options:
58 58
       --ulimit value            Ulimit options (default [])
59 59
 ```
60 60
 
61
+## Description
62
+
61 63
 Builds Docker images from a Dockerfile and a "context". A build's context is
62 64
 the files located in the specified `PATH` or `URL`. The build process can refer
63 65
 to any of the files in the context. For example, your build can use an
... ...
@@ -285,7 +287,7 @@ $ docker build - < context.tar.gz
285 285
 This will build an image for a compressed context read from `STDIN`.  Supported
286 286
 formats are: bzip2, gzip and xz.
287 287
 
288
-### Usage of .dockerignore
288
+### Use a .dockerignore file
289 289
 
290 290
 ```bash
291 291
 $ docker build .
... ...
@@ -315,7 +317,7 @@ directory from the context. Its effect can be seen in the changed size of the
315 315
 uploaded context. The builder reference contains detailed information on
316 316
 [creating a .dockerignore file](../builder.md#dockerignore-file)
317 317
 
318
-### Tag image (-t)
318
+### Tag an image (-t)
319 319
 
320 320
 ```bash
321 321
 $ docker build -t vieux/apache:2.0 .
... ...
@@ -334,7 +336,7 @@ For example, to tag an image both as `whenry/fedora-jboss:latest` and
334 334
 ```bash
335 335
 $ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 .
336 336
 ```
337
-### Specify Dockerfile (-f)
337
+### Specify a Dockerfile (-f)
338 338
 
339 339
 ```bash
340 340
 $ docker build -f Dockerfile.debug .
... ...
@@ -373,7 +375,7 @@ the command line.
373 373
 > repeatable builds on remote Docker hosts. This is also the reason why
374 374
 > `ADD ../file` will not work.
375 375
 
376
-### Optional parent cgroup (--cgroup-parent)
376
+### Use a custom parent cgroup (--cgroup-parent)
377 377
 
378 378
 When `docker build` is run with the `--cgroup-parent` option the containers
379 379
 used in the build will be run with the [corresponding `docker run`
... ...
@@ -13,7 +13,7 @@ keywords: "Docker, Docker documentation, CLI, command line"
13 13
      will be rejected.
14 14
 -->
15 15
 
16
-# Use the Docker command line
16
+# docker
17 17
 
18 18
 To list available commands, either run `docker` with no parameters
19 19
 or execute `docker help`:
... ...
@@ -43,6 +43,8 @@ Commands:
43 43
     # […]
44 44
 ```
45 45
 
46
+## Description
47
+
46 48
 Depending on your Docker system configuration, you may be required to preface
47 49
 each `docker` command with `sudo`. To avoid having to use `sudo` with the
48 50
 `docker` command, your system administrator can create a Unix group called
... ...
@@ -51,7 +53,7 @@ each `docker` command with `sudo`. To avoid having to use `sudo` with the
51 51
 For more information about installing Docker or `sudo` configuration, refer to
52 52
 the [installation](https://docs.docker.com/engine/installation/) instructions for your operating system.
53 53
 
54
-## Environment variables
54
+### Environment variables
55 55
 
56 56
 For easy reference, the following list of environment variables are supported
57 57
 by the `docker` command line:
... ...
@@ -69,7 +71,7 @@ by the `docker` command line:
69 69
   Equates to `--disable-content-trust=false` for build, create, pull, push, run.
70 70
 * `DOCKER_CONTENT_TRUST_SERVER` The URL of the Notary server to use. This defaults
71 71
   to the same URL as the registry.
72
-* `DOCKER_HIDE_LEGACY_COMMANDS` When set, Docker hides "legacy" top-level commands (such as `docker rm`, and 
72
+* `DOCKER_HIDE_LEGACY_COMMANDS` When set, Docker hides "legacy" top-level commands (such as `docker rm`, and
73 73
   `docker pull`) in `docker help` output, and only `Management commands` per object-type (e.g., `docker container`) are
74 74
   printed. This may become the default in a future release, at which point this environment-variable is removed.
75 75
 * `DOCKER_TMPDIR` Location for temporary Docker files.
... ...
@@ -85,7 +87,7 @@ These Go environment variables are case-insensitive. See the
85 85
 [Go specification](http://golang.org/pkg/net/http/) for details on these
86 86
 variables.
87 87
 
88
-## Configuration files
88
+### Configuration files
89 89
 
90 90
 By default, the Docker command line stores its configuration files in a
91 91
 directory called `.docker` within your `$HOME` directory. However, you can
... ...
@@ -165,18 +167,25 @@ attach`, `docker exec`, `docker run` or `docker start` command.
165 165
 
166 166
 Following is a sample `config.json` file:
167 167
 
168
-    {% raw %}
169
-    {
170
-      "HttpHeaders": {
171
-        "MyHeader": "MyValue"
172
-      },
173
-      "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
174
-      "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
175
-      "statsFormat": "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}",
176
-      "serviceInspectFormat": "pretty",
177
-      "detachKeys": "ctrl-e,e"
178
-    }
179
-    {% endraw %}
168
+```json
169
+{% raw %}
170
+{
171
+  "HttpHeaders": {
172
+    "MyHeader": "MyValue"
173
+  },
174
+  "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
175
+  "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
176
+  "statsFormat": "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}",
177
+  "serviceInspectFormat": "pretty",
178
+  "detachKeys": "ctrl-e,e",
179
+  "credsStore": "secretservice",
180
+  "credHelpers": {
181
+    "awesomereg.example.org": "hip-star",
182
+    "unicorn.example.com": "vcbait"
183
+  }
184
+}
185
+{% endraw %}
186
+```
180 187
 
181 188
 ### Notary
182 189
 
... ...
@@ -187,7 +196,9 @@ Certificate Authority, you need to place the certificate at
187 187
 Alternatively you can trust the certificate globally by adding it to your system's
188 188
 list of root Certificate Authorities.
189 189
 
190
-## Help
190
+## Examples
191
+
192
+### Display help text
191 193
 
192 194
 To list the help on any command just execute the command, followed by the
193 195
 `--help` option.
... ...
@@ -203,13 +214,13 @@ To list the help on any command just execute the command, followed by the
203 203
       -a, --attach value               Attach to STDIN, STDOUT or STDERR (default [])
204 204
     ...
205 205
 
206
-## Option types
206
+### Option types
207 207
 
208 208
 Single character command line options can be combined, so rather than
209 209
 typing `docker run -i -t --name test busybox sh`,
210 210
 you can write `docker run -it --name test busybox sh`.
211 211
 
212
-### Boolean
212
+#### Boolean
213 213
 
214 214
 Boolean options take the form `-d=false`. The value you see in the help text is
215 215
 the default value which is set if you do **not** specify that flag. If you
... ...
@@ -222,27 +233,33 @@ container **will** run in "detached" mode, in the background.
222 222
 Options which default to `true` (e.g., `docker build --rm=true`) can only be
223 223
 set to the non-default value by explicitly setting them to `false`:
224 224
 
225
-    $ docker build --rm=false .
225
+```bash
226
+$ docker build --rm=false .
227
+```
226 228
 
227
-### Multi
229
+#### Multi
228 230
 
229 231
 You can specify options like `-a=[]` multiple times in a single command line,
230 232
 for example in these commands:
231 233
 
232
-    $ docker run -a stdin -a stdout -i -t ubuntu /bin/bash
233
-    $ docker run -a stdin -a stdout -a stderr ubuntu /bin/ls
234
+```bash
235
+$ docker run -a stdin -a stdout -i -t ubuntu /bin/bash
236
+
237
+$ docker run -a stdin -a stdout -a stderr ubuntu /bin/ls
238
+```
234 239
 
235 240
 Sometimes, multiple options can call for a more complex value string as for
236 241
 `-v`:
237 242
 
238
-    $ docker run -v /host:/container example/mysql
243
+```bash
244
+$ docker run -v /host:/container example/mysql
245
+```
239 246
 
240
-> **Note:**
241
-> Do not use the `-t` and `-a stderr` options together due to
247
+> **Note**: Do not use the `-t` and `-a stderr` options together due to
242 248
 > limitations in the `pty` implementation. All `stderr` in `pty` mode
243 249
 > simply goes to `stdout`.
244 250
 
245
-### Strings and Integers
251
+#### Strings and Integers
246 252
 
247 253
 Options like `--name=""` expect a string, and they
248 254
 can only be specified once. Options like `-c=0`
... ...
@@ -28,6 +28,8 @@ Options:
28 28
   -p, --pause            Pause container during commit (default true)
29 29
 ```
30 30
 
31
+## Description
32
+
31 33
 It can be useful to commit a container's file changes or settings into a new
32 34
 image. This allows you debug a container by running an interactive shell, or to
33 35
 export a working dataset to another server. Generally, it is better to use
... ...
@@ -46,48 +48,72 @@ The `--change` option will apply `Dockerfile` instructions to the image that is
46 46
 created.  Supported `Dockerfile` instructions:
47 47
 `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`LABEL`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR`
48 48
 
49
-## Commit a container
50
-
51
-    $ docker ps
52
-    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
53
-    c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            desperate_dubinsky
54
-    197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            focused_hamilton
55
-    $ docker commit c3f279d17e0a  svendowideit/testimage:version3
56
-    f5283438590d
57
-    $ docker images
58
-    REPOSITORY                        TAG                 ID                  CREATED             SIZE
59
-    svendowideit/testimage            version3            f5283438590d        16 seconds ago      335.7 MB
60
-
61
-## Commit a container with new configurations
62
-
63
-    {% raw %}
64
-    $ docker ps
65
-    ICONTAINER ID       IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
66
-    c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            desperate_dubinsky
67
-    197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            focused_hamilton
68
-    $ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a
69
-    [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
70
-    $ docker commit --change "ENV DEBUG true" c3f279d17e0a  svendowideit/testimage:version3
71
-    f5283438590d
72
-    $ docker inspect -f "{{ .Config.Env }}" f5283438590d
73
-    [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true]
74
-    {% endraw %}
75
-
76
-## Commit a container with new `CMD` and `EXPOSE` instructions
77
-
78
-    $ docker ps
79
-    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
80
-    c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            desperate_dubinsky
81
-    197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            focused_hamilton
82
-
83
-    $ docker commit --change='CMD ["apachectl", "-DFOREGROUND"]' -c "EXPOSE 80" c3f279d17e0a  svendowideit/testimage:version4
84
-    f5283438590d
85
-
86
-    $ docker run -d svendowideit/testimage:version4
87
-    89373736e2e7f00bc149bd783073ac43d0507da250e999f3f1036e0db60817c0
88
-
89
-    $ docker ps
90
-    CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS              PORTS              NAMES
91
-    89373736e2e7        testimage:version4  "apachectl -DFOREGROU"  3 seconds ago       Up 2 seconds        80/tcp             distracted_fermat
92
-    c3f279d17e0a        ubuntu:12.04        /bin/bash               7 days ago          Up 25 hours                            desperate_dubinsky
93
-    197387f1b436        ubuntu:12.04        /bin/bash               7 days ago          Up 25 hours                            focused_hamilton
49
+## Examples
50
+
51
+### Commit a container
52
+
53
+```bash
54
+$ docker ps
55
+
56
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
57
+c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            desperate_dubinsky
58
+197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            focused_hamilton
59
+
60
+$ docker commit c3f279d17e0a  svendowideit/testimage:version3
61
+
62
+f5283438590d
63
+
64
+$ docker images
65
+
66
+REPOSITORY                        TAG                 ID                  CREATED             SIZE
67
+svendowideit/testimage            version3            f5283438590d        16 seconds ago      335.7 MB
68
+```
69
+
70
+### Commit a container with new configurations
71
+
72
+```bash
73
+{% raw %}
74
+$ docker ps
75
+
76
+ICONTAINER ID       IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
77
+c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            desperate_dubinsky
78
+197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            focused_hamilton
79
+
80
+$ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a
81
+
82
+[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
83
+
84
+$ docker commit --change "ENV DEBUG true" c3f279d17e0a  svendowideit/testimage:version3
85
+
86
+f5283438590d
87
+
88
+$ docker inspect -f "{{ .Config.Env }}" f5283438590d
89
+
90
+[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true]
91
+{% endraw %}
92
+```
93
+
94
+### Commit a container with new `CMD` and `EXPOSE` instructions
95
+
96
+```bash
97
+$ docker ps
98
+
99
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS              NAMES
100
+c3f279d17e0a        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            desperate_dubinsky
101
+197387f1b436        ubuntu:12.04        /bin/bash           7 days ago          Up 25 hours                            focused_hamilton
102
+
103
+$ docker commit --change='CMD ["apachectl", "-DFOREGROUND"]' -c "EXPOSE 80" c3f279d17e0a  svendowideit/testimage:version4
104
+
105
+f5283438590d
106
+
107
+$ docker run -d svendowideit/testimage:version4
108
+
109
+89373736e2e7f00bc149bd783073ac43d0507da250e999f3f1036e0db60817c0
110
+
111
+$ docker ps
112
+
113
+CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS              PORTS              NAMES
114
+89373736e2e7        testimage:version4  "apachectl -DFOREGROU"  3 seconds ago       Up 2 seconds        80/tcp             distracted_fermat
115
+c3f279d17e0a        ubuntu:12.04        /bin/bash               7 days ago          Up 25 hours                            desperate_dubinsky
116
+197387f1b436        ubuntu:12.04        /bin/bash               7 days ago          Up 25 hours                            focused_hamilton
117
+```
... ...
@@ -25,8 +25,14 @@ Options:
25 25
       --help    Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
30
+Removes all stopped containers.
31
+
28 32
 ## Examples
29 33
 
34
+### Prune containers
35
+
30 36
 ```bash
31 37
 $ docker container prune
32 38
 WARNING! This will remove all stopped containers.
... ...
@@ -38,7 +44,76 @@ f98f9c2aa1eaf727e4ec9c0283bc7d4aa4762fbdba7f26191f26c97f64090360
38 38
 Total reclaimed space: 212 B
39 39
 ```
40 40
 
41
-## Related information
41
+### Filtering
42
+
43
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
44
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
45
+
46
+The currently supported filters are:
47
+
48
+* until (`<timestamp>`) - only remove containers created before given timestamp
49
+
50
+The `until` filter can be Unix timestamps, date formatted
51
+timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
52
+relative to the daemon machine’s time. Supported formats for date
53
+formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
54
+`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
55
+timezone on the daemon will be used if you do not provide either a `Z` or a
56
+`+-00:00` timezone offset at the end of the timestamp.  When providing Unix
57
+timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
58
+that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
59
+seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
60
+fraction of a second no more than nine digits long.
61
+
62
+The following removes containers created more than 5 minutes ago:
63
+
64
+```bash
65
+{% raw %}
66
+$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
67
+
68
+CONTAINER ID        IMAGE               COMMAND             CREATED AT                      STATUS
69
+61b9efa71024        busybox             "sh"                2017-01-04 13:23:33 -0800 PST   Exited (0) 41 seconds ago
70
+53a9bc23a516        busybox             "sh"                2017-01-04 13:11:59 -0800 PST   Exited (0) 12 minutes ago
71
+
72
+$ docker container prune --force --filter "until=5m"
73
+
74
+Deleted Containers:
75
+53a9bc23a5168b6caa2bfbefddf1b30f93c7ad57f3dec271fd32707497cb9369
76
+
77
+Total reclaimed space: 25 B
78
+
79
+$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
80
+
81
+CONTAINER ID        IMAGE               COMMAND             CREATED AT                      STATUS
82
+61b9efa71024        busybox             "sh"                2017-01-04 13:23:33 -0800 PST   Exited (0) 44 seconds ago
83
+{% endraw %}
84
+```
85
+
86
+The following removes containers created before `2017-01-04T13:10:00`:
87
+
88
+```bash
89
+{% raw %}
90
+$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
91
+
92
+CONTAINER ID        IMAGE               COMMAND             CREATED AT                      STATUS
93
+53a9bc23a516        busybox             "sh"                2017-01-04 13:11:59 -0800 PST   Exited (0) 7 minutes ago
94
+4a75091a6d61        busybox             "sh"                2017-01-04 13:09:53 -0800 PST   Exited (0) 9 minutes ago
95
+
96
+$ docker container prune --force --filter "until=2017-01-04T13:10:00"
97
+
98
+Deleted Containers:
99
+4a75091a6d618526fcd8b33ccd6e5928ca2a64415466f768a6180004b0c72c6c
100
+
101
+Total reclaimed space: 27 B
102
+
103
+$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
104
+
105
+CONTAINER ID        IMAGE               COMMAND             CREATED AT                      STATUS
106
+53a9bc23a516        busybox             "sh"                2017-01-04 13:11:59 -0800 PST   Exited (0) 9 minutes ago
107
+{% endraw %}
108
+```
109
+
110
+## Related commands
42 111
 
43 112
 * [system df](system_df.md)
44 113
 * [volume prune](volume_prune.md)
... ...
@@ -31,6 +31,8 @@ Options:
31 31
       --help          Print usage
32 32
 ```
33 33
 
34
+## Description
35
+
34 36
 The `docker cp` utility copies the contents of `SRC_PATH` to the `DEST_PATH`.
35 37
 You can copy from the container's file system to the local machine or the
36 38
 reverse, from the local filesystem to the container. If `-` is specified for
... ...
@@ -96,15 +98,16 @@ you must be explicit with a relative or absolute path, for example:
96 96
 It is not possible to copy certain system files such as resources under
97 97
 `/proc`, `/sys`, `/dev`, [tmpfs](run.md#mount-tmpfs-tmpfs), and mounts created by
98 98
 the user in the container. However, you can still copy such files by manually
99
-running `tar` in `docker exec`. For example (consider `SRC_PATH` and `DEST_PATH`
100
-are directories):
101
-
102
-    $ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH -
103
-
104
-or
99
+running `tar` in `docker exec`. Both of the following examples do the same thing
100
+in different ways (consider `SRC_PATH` and `DEST_PATH` are directories):
105 101
 
106
-    $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo tar Cxf DEST_PATH -
102
+```bash
103
+$ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH -
104
+```
107 105
 
106
+```bash
107
+$ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo tar Cxf DEST_PATH -
108
+```
108 109
 
109 110
 Using `-` as the `SRC_PATH` streams the contents of `STDIN` as a tar archive.
110 111
 The command extracts the content of the tar to the `DEST_PATH` in container's
... ...
@@ -132,6 +132,7 @@ Options:
132 132
       --volumes-from value          Mount volumes from the specified container(s) (default [])
133 133
   -w, --workdir string              Working directory inside the container
134 134
 ```
135
+## Description
135 136
 
136 137
 The `docker create` command creates a writeable container layer over the
137 138
 specified image and prepares it for running the specified command.  The
... ...
@@ -147,42 +148,64 @@ Please see the [run command](run.md) section and the [Docker run reference](../r
147 147
 
148 148
 ## Examples
149 149
 
150
-    $ docker create -t -i fedora bash
151
-    6d8af538ec541dd581ebc2a24153a28329acb5268abe5ef868c1f1a261221752
152
-    $ docker start -a -i 6d8af538ec5
153
-    bash-4.2#
150
+### Create and start a container
151
+
152
+```bash
153
+$ docker create -t -i fedora bash
154
+
155
+6d8af538ec541dd581ebc2a24153a28329acb5268abe5ef868c1f1a261221752
156
+
157
+$ docker start -a -i 6d8af538ec5
158
+
159
+bash-4.2#
160
+```
161
+
162
+### Initialize volumes
154 163
 
155 164
 As of v1.4.0 container volumes are initialized during the `docker create` phase
156 165
 (i.e., `docker run` too). For example, this allows you to `create` the `data`
157 166
 volume container, and then use it from another container:
158 167
 
159
-    $ docker create -v /data --name data ubuntu
160
-    240633dfbb98128fa77473d3d9018f6123b99c454b3251427ae190a7d951ad57
161
-    $ docker run --rm --volumes-from data ubuntu ls -la /data
162
-    total 8
163
-    drwxr-xr-x  2 root root 4096 Dec  5 04:10 .
164
-    drwxr-xr-x 48 root root 4096 Dec  5 04:11 ..
168
+```bash
169
+$ docker create -v /data --name data ubuntu
170
+
171
+240633dfbb98128fa77473d3d9018f6123b99c454b3251427ae190a7d951ad57
172
+
173
+$ docker run --rm --volumes-from data ubuntu ls -la /data
174
+
175
+total 8
176
+drwxr-xr-x  2 root root 4096 Dec  5 04:10 .
177
+drwxr-xr-x 48 root root 4096 Dec  5 04:11 ..
178
+```
165 179
 
166 180
 Similarly, `create` a host directory bind mounted volume container, which can
167 181
 then be used from the subsequent container:
168 182
 
169
-    $ docker create -v /home/docker:/docker --name docker ubuntu
170
-    9aa88c08f319cd1e4515c3c46b0de7cc9aa75e878357b1e96f91e2c773029f03
171
-    $ docker run --rm --volumes-from docker ubuntu ls -la /docker
172
-    total 20
173
-    drwxr-sr-x  5 1000 staff  180 Dec  5 04:00 .
174
-    drwxr-xr-x 48 root root  4096 Dec  5 04:13 ..
175
-    -rw-rw-r--  1 1000 staff 3833 Dec  5 04:01 .ash_history
176
-    -rw-r--r--  1 1000 staff  446 Nov 28 11:51 .ashrc
177
-    -rw-r--r--  1 1000 staff   25 Dec  5 04:00 .gitconfig
178
-    drwxr-sr-x  3 1000 staff   60 Dec  1 03:28 .local
179
-    -rw-r--r--  1 1000 staff  920 Nov 28 11:51 .profile
180
-    drwx--S---  2 1000 staff  460 Dec  5 00:51 .ssh
181
-    drwxr-xr-x 32 1000 staff 1140 Dec  5 04:01 docker
183
+```bash
184
+$ docker create -v /home/docker:/docker --name docker ubuntu
185
+
186
+9aa88c08f319cd1e4515c3c46b0de7cc9aa75e878357b1e96f91e2c773029f03
187
+
188
+$ docker run --rm --volumes-from docker ubuntu ls -la /docker
189
+
190
+total 20
191
+drwxr-sr-x  5 1000 staff  180 Dec  5 04:00 .
192
+drwxr-xr-x 48 root root  4096 Dec  5 04:13 ..
193
+-rw-rw-r--  1 1000 staff 3833 Dec  5 04:01 .ash_history
194
+-rw-r--r--  1 1000 staff  446 Nov 28 11:51 .ashrc
195
+-rw-r--r--  1 1000 staff   25 Dec  5 04:00 .gitconfig
196
+drwxr-sr-x  3 1000 staff   60 Dec  1 03:28 .local
197
+-rw-r--r--  1 1000 staff  920 Nov 28 11:51 .profile
198
+drwx--S---  2 1000 staff  460 Dec  5 00:51 .ssh
199
+drwxr-xr-x 32 1000 staff 1140 Dec  5 04:01 docker
200
+```
201
+
182 202
 
183 203
 Set storage driver options per container.
184 204
 
185
-    $ docker create -it --storage-opt size=120G fedora /bin/bash
205
+```bash
206
+$ docker create -it --storage-opt size=120G fedora /bin/bash
207
+```
186 208
 
187 209
 This (size) will allow to set the container rootfs size to 120G at creation time.
188 210
 This option is only available for the `devicemapper`, `btrfs`, `overlay2`,
... ...
@@ -14,7 +14,9 @@ advisory: "experimental"
14 14
      will be rejected.
15 15
 -->
16 16
 
17
-# deploy (alias for stack deploy) (experimental)
17
+# deploy (experimental)
18
+
19
+An alias for `stack deploy`.
18 20
 
19 21
 ```markdown
20 22
 Usage:  docker deploy [OPTIONS] STACK
... ...
@@ -31,15 +33,20 @@ Options:
31 31
       --with-registry-auth    Send registry authentication details to Swarm agents
32 32
 ```
33 33
 
34
+## Description
35
+
34 36
 Create and update a stack from a `compose` or a `dab` file on the swarm. This command
35 37
 has to be run targeting a manager node.
36 38
 
37
-## Compose file
39
+## Examples
40
+
41
+### Compose file
38 42
 
39 43
 The `deploy` command supports compose file version `3.0` and above.
40 44
 
41 45
 ```bash
42 46
 $ docker stack deploy --compose-file docker-compose.yml vossibility
47
+
43 48
 Ignoring unsupported options: links
44 49
 
45 50
 Creating network vossibility_vossibility
... ...
@@ -54,8 +61,9 @@ Creating service vossibility_lookupd
54 54
 
55 55
 You can verify that the services were correctly created
56 56
 
57
-```
57
+```bash
58 58
 $ docker service ls
59
+
59 60
 ID            NAME                               MODE        REPLICAS  IMAGE
60 61
 29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
61 62
 4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
... ...
@@ -65,10 +73,11 @@ ID            NAME                               MODE        REPLICAS  IMAGE
65 65
 axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
66 66
 ```
67 67
 
68
-## DAB file
68
+### DAB file
69 69
 
70 70
 ```bash
71 71
 $ docker stack deploy --bundle-file vossibility-stack.dab vossibility
72
+
72 73
 Loading bundle from vossibility-stack.dab
73 74
 Creating service vossibility_elasticsearch
74 75
 Creating service vossibility_kibana
... ...
@@ -82,6 +91,7 @@ You can verify that the services were correctly created:
82 82
 
83 83
 ```bash
84 84
 $ docker service ls
85
+
85 86
 ID            NAME                               MODE        REPLICAS  IMAGE
86 87
 29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
87 88
 4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
... ...
@@ -91,7 +101,7 @@ ID            NAME                               MODE        REPLICAS  IMAGE
91 91
 axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
92 92
 ```
93 93
 
94
-## Related information
94
+## Related commands
95 95
 
96 96
 * [stack config](stack_config.md)
97 97
 * [stack deploy](stack_deploy.md)
... ...
@@ -13,7 +13,7 @@ keywords: "list, changed, files, container"
13 13
      will be rejected.
14 14
 -->
15 15
 
16
-## diff
16
+# diff
17 17
 
18 18
 ```markdown
19 19
 Usage:  docker diff CONTAINER
... ...
@@ -24,6 +24,8 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
+## Description
28
+
27 29
 List the changed files and directories in a container᾿s filesystem since the
28 30
 container was created. Three different types of change are tracked:
29 31
 
30 32
deleted file mode 100644
31 33
Binary files a/docs/reference/commandline/docker_images.gif and /dev/null differ
... ...
@@ -92,13 +92,17 @@ Options:
92 92
 
93 93
 Options with [] may be specified multiple times.
94 94
 
95
-dockerd is the persistent process that manages containers. Docker
95
+## Description
96
+
97
+`dockerd` is the persistent process that manages containers. Docker
96 98
 uses different binaries for the daemon and client. To run the daemon you
97 99
 type `dockerd`.
98 100
 
99 101
 To run the daemon with debug output, use `dockerd -D`.
100 102
 
101
-## Daemon socket option
103
+## Examples
104
+
105
+### Daemon socket option
102 106
 
103 107
 The Docker daemon can listen for [Docker Engine API](../api/)
104 108
 requests via three different types of Socket: `unix`, `tcp`, and `fd`.
... ...
@@ -117,8 +121,7 @@ interface using its IP address: `-H tcp://192.168.59.103:2375`. It is
117 117
 conventional to use port `2375` for un-encrypted, and port `2376` for encrypted
118 118
 communication with the daemon.
119 119
 
120
-> **Note:**
121
-> If you're using an HTTPS encrypted socket, keep in mind that only
120
+> **Note**: If you're using an HTTPS encrypted socket, keep in mind that only
122 121
 > TLS1.0 and greater are supported. Protocols SSLv3 and under are not
123 122
 > supported anymore for security reasons.
124 123
 
... ...
@@ -135,18 +138,21 @@ time using multiple `-H` options:
135 135
 
136 136
 ```bash
137 137
 # listen using the default unix socket, and on 2 specific IP addresses on this host.
138
+
138 139
 $ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
139 140
 ```
140 141
 
141 142
 The Docker client will honor the `DOCKER_HOST` environment variable to set the
142
-`-H` flag for the client.
143
+`-H` flag for the client. Use **one** of the following commands:
143 144
 
144 145
 ```bash
145 146
 $ docker -H tcp://0.0.0.0:2375 ps
146
-# or
147
+```
148
+
149
+```bash
147 150
 $ export DOCKER_HOST="tcp://0.0.0.0:2375"
151
+
148 152
 $ docker ps
149
-# both are equal
150 153
 ```
151 154
 
152 155
 Setting the `DOCKER_TLS_VERIFY` environment variable to any value other than
... ...
@@ -164,7 +170,7 @@ The Docker client will honor the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`
164 164
 environment variables (or the lowercase versions thereof). `HTTPS_PROXY` takes
165 165
 precedence over `HTTP_PROXY`.
166 166
 
167
-### Bind Docker to another host/port or a Unix socket
167
+#### Bind Docker to another host/port or a Unix socket
168 168
 
169 169
 > **Warning**:
170 170
 > Changing the default `docker` daemon binding to a
... ...
@@ -230,7 +236,7 @@ $ docker pull ubuntu
230 230
 $ docker -H tcp://127.0.0.1:2375 pull ubuntu
231 231
 ```
232 232
 
233
-### Daemon storage-driver option
233
+### Daemon storage-driver
234 234
 
235 235
 The Docker daemon has support for several different image layer storage
236 236
 drivers: `aufs`, `devicemapper`, `btrfs`, `zfs`, `overlay` and `overlay2`.
... ...
@@ -267,22 +273,20 @@ the same file can share a single page cache entry (or entries), it makes
267 267
 `overlay` as efficient with memory as `aufs` driver. Call
268 268
 `dockerd -s overlay` to use it.
269 269
 
270
-> **Note:**
271
-> As promising as `overlay` is, the feature is still quite young and should not
272
-> be used in production. Most notably, using `overlay` can cause excessive
273
-> inode consumption (especially as the number of images grows), as well as
274
-> being incompatible with the use of RPMs.
270
+> **Note**: As promising as `overlay` is, the feature is still quite young and
271
+> should not be used in production. Most notably, using `overlay` can cause
272
+> excessive inode consumption (especially as the number of images grows), as
273
+> well as > being incompatible with the use of RPMs.
275 274
 
276 275
 The `overlay2` uses the same fast union filesystem but takes advantage of
277 276
 [additional features](https://lkml.org/lkml/2015/2/11/106) added in Linux
278 277
 kernel 4.0 to avoid excessive inode consumption. Call `dockerd -s overlay2`
279 278
 to use it.
280 279
 
281
-> **Note:**
282
-> Both `overlay` and `overlay2` are currently unsupported on `btrfs` or any
283
-> Copy on Write filesystem and should only be used over `ext4` partitions.
280
+> **Note**: Both `overlay` and `overlay2` are currently unsupported on `btrfs`
281
+> or any Copy on Write filesystem and should only be used over `ext4` partitions.
284 282
 
285
-### Storage driver options
283
+### Options per storage driver
286 284
 
287 285
 Particular storage-driver can be configured with options specified with
288 286
 `--storage-opt` flags. Options for `devicemapper` are prefixed with `dm`,
... ...
@@ -290,380 +294,376 @@ options for `zfs` start with `zfs` and options for `btrfs` start with `btrfs`.
290 290
 
291 291
 #### Devicemapper options
292 292
 
293
-*   `dm.thinpooldev`
293
+##### `dm.thinpooldev`
294 294
 
295
-    Specifies a custom block storage device to use for the thin pool.
295
+Specifies a custom block storage device to use for the thin pool.
296 296
 
297
-    If using a block device for device mapper storage, it is best to use `lvm`
298
-    to create and manage the thin-pool volume. This volume is then handed to Docker
299
-    to exclusively create snapshot volumes needed for images and containers.
297
+If using a block device for device mapper storage, it is best to use `lvm`
298
+to create and manage the thin-pool volume. This volume is then handed to Docker
299
+to exclusively create snapshot volumes needed for images and containers.
300 300
 
301
-    Managing the thin-pool outside of Engine makes for the most feature-rich
302
-    method of having Docker utilize device mapper thin provisioning as the
303
-    backing storage for Docker containers. The highlights of the lvm-based
304
-    thin-pool management feature include: automatic or interactive thin-pool
305
-    resize support, dynamically changing thin-pool features, automatic thinp
306
-    metadata checking when lvm activates the thin-pool, etc.
301
+Managing the thin-pool outside of Engine makes for the most feature-rich
302
+method of having Docker utilize device mapper thin provisioning as the
303
+backing storage for Docker containers. The highlights of the lvm-based
304
+thin-pool management feature include: automatic or interactive thin-pool
305
+resize support, dynamically changing thin-pool features, automatic thinp
306
+metadata checking when lvm activates the thin-pool, etc.
307 307
 
308
-    As a fallback if no thin pool is provided, loopback files are
309
-    created. Loopback is very slow, but can be used without any
310
-    pre-configuration of storage. It is strongly recommended that you do
311
-    not use loopback in production. Ensure your Engine daemon has a
312
-    `--storage-opt dm.thinpooldev` argument provided.
308
+As a fallback if no thin pool is provided, loopback files are
309
+created. Loopback is very slow, but can be used without any
310
+pre-configuration of storage. It is strongly recommended that you do
311
+not use loopback in production. Ensure your Engine daemon has a
312
+`--storage-opt dm.thinpooldev` argument provided.
313 313
 
314
-    Example use:
314
+###### Example:
315 315
 
316
-    ```bash
317
-    $ sudo dockerd --storage-opt dm.thinpooldev=/dev/mapper/thin-pool
318
-    ```
316
+```bash
317
+$ sudo dockerd --storage-opt dm.thinpooldev=/dev/mapper/thin-pool
318
+```
319 319
 
320
-*   `dm.basesize`
320
+##### `dm.basesize`
321 321
 
322
-    Specifies the size to use when creating the base device, which limits the
323
-    size of images and containers. The default value is 10G. Note, thin devices
324
-    are inherently "sparse", so a 10G device which is mostly empty doesn't use
325
-    10 GB of space on the pool. However, the filesystem will use more space for
326
-    the empty case the larger the device is.
322
+Specifies the size to use when creating the base device, which limits the
323
+size of images and containers. The default value is 10G. Note, thin devices
324
+are inherently "sparse", so a 10G device which is mostly empty doesn't use
325
+10 GB of space on the pool. However, the filesystem will use more space for
326
+the empty case the larger the device is.
327 327
 
328
-    The base device size can be increased at daemon restart which will allow
329
-    all future images and containers (based on those new images) to be of the
330
-    new base device size.
328
+The base device size can be increased at daemon restart which will allow
329
+all future images and containers (based on those new images) to be of the
330
+new base device size.
331 331
 
332
-    Example use:
332
+###### Examples
333 333
 
334
-    ```bash
335
-    $ sudo dockerd --storage-opt dm.basesize=50G
336
-    ```
334
+```bash
335
+$ sudo dockerd --storage-opt dm.basesize=50G
336
+```
337 337
 
338
-    This will increase the base device size to 50G. The Docker daemon will throw an
339
-    error if existing base device size is larger than 50G. A user can use
340
-    this option to expand the base device size however shrinking is not permitted.
338
+This will increase the base device size to 50G. The Docker daemon will throw an
339
+error if existing base device size is larger than 50G. A user can use
340
+this option to expand the base device size however shrinking is not permitted.
341 341
 
342
-    This value affects the system-wide "base" empty filesystem
343
-    that may already be initialized and inherited by pulled images. Typically,
344
-    a change to this value requires additional steps to take effect:
342
+This value affects the system-wide "base" empty filesystem
343
+that may already be initialized and inherited by pulled images. Typically,
344
+a change to this value requires additional steps to take effect:
345 345
 
346
-     ```bash
347
-    $ sudo service docker stop
348
-    $ sudo rm -rf /var/lib/docker
349
-    $ sudo service docker start
350
-    ```
346
+ ```bash
347
+$ sudo service docker stop
351 348
 
352
-    Example use:
349
+$ sudo rm -rf /var/lib/docker
353 350
 
354
-    ```bash
355
-    $ sudo dockerd --storage-opt dm.basesize=20G
356
-    ```
351
+$ sudo service docker start
352
+```
357 353
 
358
-*   `dm.loopdatasize`
359 354
 
360
-    > **Note**:
361
-    > This option configures devicemapper loopback, which should not
362
-    > be used in production.
355
+##### `dm.loopdatasize`
363 356
 
364
-    Specifies the size to use when creating the loopback file for the
365
-    "data" device which is used for the thin pool. The default size is
366
-    100G. The file is sparse, so it will not initially take up this
367
-    much space.
357
+> **Note**: This option configures devicemapper loopback, which should not
358
+> be used in production.
368 359
 
369
-    Example use:
360
+Specifies the size to use when creating the loopback file for the
361
+"data" device which is used for the thin pool. The default size is
362
+100G. The file is sparse, so it will not initially take up this
363
+much space.
370 364
 
371
-    ```bash
372
-    $ sudo dockerd --storage-opt dm.loopdatasize=200G
373
-    ```
365
+###### Example
374 366
 
375
-*   `dm.loopmetadatasize`
367
+```bash
368
+$ sudo dockerd --storage-opt dm.loopdatasize=200G
369
+```
376 370
 
377
-    > **Note**:
378
-    > This option configures devicemapper loopback, which should not
379
-    > be used in production.
371
+##### `dm.loopmetadatasize`
380 372
 
381
-    Specifies the size to use when creating the loopback file for the
382
-    "metadata" device which is used for the thin pool. The default size
383
-    is 2G. The file is sparse, so it will not initially take up
384
-    this much space.
373
+> **Note**: This option configures devicemapper loopback, which should not
374
+> be used in production.
385 375
 
386
-    Example use:
376
+Specifies the size to use when creating the loopback file for the
377
+"metadata" device which is used for the thin pool. The default size
378
+is 2G. The file is sparse, so it will not initially take up
379
+this much space.
387 380
 
388
-    ```bash
389
-    $ sudo dockerd --storage-opt dm.loopmetadatasize=4G
390
-    ```
381
+###### Example
391 382
 
392
-*   `dm.fs`
383
+```bash
384
+$ sudo dockerd --storage-opt dm.loopmetadatasize=4G
385
+```
393 386
 
394
-    Specifies the filesystem type to use for the base device. The supported
395
-    options are "ext4" and "xfs". The default is "xfs"
387
+##### `dm.fs`
396 388
 
397
-    Example use:
389
+Specifies the filesystem type to use for the base device. The supported
390
+options are "ext4" and "xfs". The default is "xfs"
398 391
 
399
-    ```bash
400
-    $ sudo dockerd --storage-opt dm.fs=ext4
401
-    ```
392
+###### Example
402 393
 
403
-*   `dm.mkfsarg`
394
+```bash
395
+$ sudo dockerd --storage-opt dm.fs=ext4
396
+```
404 397
 
405
-    Specifies extra mkfs arguments to be used when creating the base device.
398
+##### `dm.mkfsarg`
406 399
 
407
-    Example use:
400
+Specifies extra mkfs arguments to be used when creating the base device.
408 401
 
409
-    ```bash
410
-    $ sudo dockerd --storage-opt "dm.mkfsarg=-O ^has_journal"
411
-    ```
402
+###### Example
412 403
 
413
-*   `dm.mountopt`
404
+```bash
405
+$ sudo dockerd --storage-opt "dm.mkfsarg=-O ^has_journal"
406
+```
414 407
 
415
-    Specifies extra mount options used when mounting the thin devices.
408
+##### `dm.mountopt`
416 409
 
417
-    Example use:
410
+Specifies extra mount options used when mounting the thin devices.
418 411
 
419
-    ```bash
420
-    $ sudo dockerd --storage-opt dm.mountopt=nodiscard
421
-    ```
412
+###### Example
422 413
 
423
-*   `dm.datadev`
414
+```bash
415
+$ sudo dockerd --storage-opt dm.mountopt=nodiscard
416
+```
424 417
 
425
-    (Deprecated, use `dm.thinpooldev`)
418
+##### `dm.datadev`
426 419
 
427
-    Specifies a custom blockdevice to use for data for the thin pool.
420
+(Deprecated, use `dm.thinpooldev`)
428 421
 
429
-    If using a block device for device mapper storage, ideally both datadev and
430
-    metadatadev should be specified to completely avoid using the loopback
431
-    device.
422
+Specifies a custom blockdevice to use for data for the thin pool.
432 423
 
433
-    Example use:
424
+If using a block device for device mapper storage, ideally both `datadev` and
425
+`metadatadev` should be specified to completely avoid using the loopback
426
+device.
434 427
 
435
-    ```bash
436
-    $ sudo dockerd \
437
-          --storage-opt dm.datadev=/dev/sdb1 \
438
-          --storage-opt dm.metadatadev=/dev/sdc1
439
-    ```
428
+###### Example
440 429
 
441
-*   `dm.metadatadev`
430
+```bash
431
+$ sudo dockerd \
432
+      --storage-opt dm.datadev=/dev/sdb1 \
433
+      --storage-opt dm.metadatadev=/dev/sdc1
434
+```
442 435
 
443
-    (Deprecated, use `dm.thinpooldev`)
436
+##### `dm.metadatadev`
444 437
 
445
-    Specifies a custom blockdevice to use for metadata for the thin pool.
438
+(Deprecated, use `dm.thinpooldev`)
446 439
 
447
-    For best performance the metadata should be on a different spindle than the
448
-    data, or even better on an SSD.
440
+Specifies a custom blockdevice to use for metadata for the thin pool.
449 441
 
450
-    If setting up a new metadata pool it is required to be valid. This can be
451
-    achieved by zeroing the first 4k to indicate empty metadata, like this:
442
+For best performance the metadata should be on a different spindle than the
443
+data, or even better on an SSD.
452 444
 
453
-    ```bash
454
-    $ dd if=/dev/zero of=$metadata_dev bs=4096 count=1
455
-    ```
445
+If setting up a new metadata pool it is required to be valid. This can be
446
+achieved by zeroing the first 4k to indicate empty metadata, like this:
456 447
 
457
-    Example use:
448
+```bash
449
+$ dd if=/dev/zero of=$metadata_dev bs=4096 count=1
450
+```
458 451
 
459
-    ```bash
460
-    $ sudo dockerd \
461
-          --storage-opt dm.datadev=/dev/sdb1 \
462
-          --storage-opt dm.metadatadev=/dev/sdc1
463
-    ```
452
+###### Example
464 453
 
465
-*   `dm.blocksize`
454
+```bash
455
+$ sudo dockerd \
456
+      --storage-opt dm.datadev=/dev/sdb1 \
457
+      --storage-opt dm.metadatadev=/dev/sdc1
458
+```
466 459
 
467
-    Specifies a custom blocksize to use for the thin pool. The default
468
-    blocksize is 64K.
460
+##### `dm.blocksize`
469 461
 
470
-    Example use:
462
+Specifies a custom blocksize to use for the thin pool. The default
463
+blocksize is 64K.
471 464
 
472
-    ```bash
473
-    $ sudo dockerd --storage-opt dm.blocksize=512K
474
-    ```
465
+###### Example
475 466
 
476
-*   `dm.blkdiscard`
467
+```bash
468
+$ sudo dockerd --storage-opt dm.blocksize=512K
469
+```
477 470
 
478
-    Enables or disables the use of blkdiscard when removing devicemapper
479
-    devices. This is enabled by default (only) if using loopback devices and is
480
-    required to resparsify the loopback file on image/container removal.
471
+##### `dm.blkdiscard`
481 472
 
482
-    Disabling this on loopback can lead to *much* faster container removal
483
-    times, but will make the space used in `/var/lib/docker` directory not be
484
-    returned to the system for other use when containers are removed.
473
+Enables or disables the use of `blkdiscard` when removing devicemapper
474
+devices. This is enabled by default (only) if using loopback devices and is
475
+required to resparsify the loopback file on image/container removal.
485 476
 
486
-    Example use:
477
+Disabling this on loopback can lead to *much* faster container removal
478
+times, but will make the space used in `/var/lib/docker` directory not be
479
+returned to the system for other use when containers are removed.
487 480
 
488
-    ```bash
489
-    $ sudo dockerd --storage-opt dm.blkdiscard=false
490
-    ```
481
+###### Examples
491 482
 
492
-*   `dm.override_udev_sync_check`
483
+```bash
484
+$ sudo dockerd --storage-opt dm.blkdiscard=false
485
+```
493 486
 
494
-    Overrides the `udev` synchronization checks between `devicemapper` and `udev`.
495
-    `udev` is the device manager for the Linux kernel.
487
+##### `dm.override_udev_sync_check`
496 488
 
497
-    To view the `udev` sync support of a Docker daemon that is using the
498
-    `devicemapper` driver, run:
489
+Overrides the `udev` synchronization checks between `devicemapper` and `udev`.
490
+`udev` is the device manager for the Linux kernel.
499 491
 
500
-    ```bash
501
-    $ docker info
502
-    [...]
503
-    Udev Sync Supported: true
504
-    [...]
505
-    ```
492
+To view the `udev` sync support of a Docker daemon that is using the
493
+`devicemapper` driver, run:
506 494
 
507
-    When `udev` sync support is `true`, then `devicemapper` and udev can
508
-    coordinate the activation and deactivation of devices for containers.
495
+```bash
496
+$ docker info
497
+[...]
498
+Udev Sync Supported: true
499
+[...]
500
+```
509 501
 
510
-    When `udev` sync support is `false`, a race condition occurs between
511
-    the`devicemapper` and `udev` during create and cleanup. The race condition
512
-    results in errors and failures. (For information on these failures, see
513
-    [docker#4036](https://github.com/docker/docker/issues/4036))
502
+When `udev` sync support is `true`, then `devicemapper` and udev can
503
+coordinate the activation and deactivation of devices for containers.
514 504
 
515
-    To allow the `docker` daemon to start, regardless of `udev` sync not being
516
-    supported, set `dm.override_udev_sync_check` to true:
505
+When `udev` sync support is `false`, a race condition occurs between
506
+the`devicemapper` and `udev` during create and cleanup. The race condition
507
+results in errors and failures. (For information on these failures, see
508
+[docker#4036](https://github.com/docker/docker/issues/4036))
517 509
 
518
-    ```bash
519
-    $ sudo dockerd --storage-opt dm.override_udev_sync_check=true
520
-    ```
510
+To allow the `docker` daemon to start, regardless of `udev` sync not being
511
+supported, set `dm.override_udev_sync_check` to true:
521 512
 
522
-    When this value is `true`, the  `devicemapper` continues and simply warns
523
-    you the errors are happening.
513
+```bash
514
+$ sudo dockerd --storage-opt dm.override_udev_sync_check=true
515
+```
524 516
 
525
-    > **Note:**
526
-    > The ideal is to pursue a `docker` daemon and environment that does
527
-    > support synchronizing with `udev`. For further discussion on this
528
-    > topic, see [docker#4036](https://github.com/docker/docker/issues/4036).
529
-    > Otherwise, set this flag for migrating existing Docker daemons to
530
-    > a daemon with a supported environment.
517
+When this value is `true`, the  `devicemapper` continues and simply warns
518
+you the errors are happening.
531 519
 
532
-*   `dm.use_deferred_removal`
520
+> **Note**: The ideal is to pursue a `docker` daemon and environment that does
521
+> support synchronizing with `udev`. For further discussion on this
522
+> topic, see [docker#4036](https://github.com/docker/docker/issues/4036).
523
+> Otherwise, set this flag for migrating existing Docker daemons to
524
+> a daemon with a supported environment.
533 525
 
534
-    Enables use of deferred device removal if `libdm` and the kernel driver
535
-    support the mechanism.
526
+##### `dm.use_deferred_removal`
536 527
 
537
-    Deferred device removal means that if device is busy when devices are
538
-    being removed/deactivated, then a deferred removal is scheduled on
539
-    device. And devices automatically go away when last user of the device
540
-    exits.
528
+Enables use of deferred device removal if `libdm` and the kernel driver
529
+support the mechanism.
541 530
 
542
-    For example, when a container exits, its associated thin device is removed.
543
-    If that device has leaked into some other mount namespace and can't be
544
-    removed, the container exit still succeeds and this option causes the
545
-    system to schedule the device for deferred removal. It does not wait in a
546
-    loop trying to remove a busy device.
531
+Deferred device removal means that if device is busy when devices are
532
+being removed/deactivated, then a deferred removal is scheduled on
533
+device. And devices automatically go away when last user of the device
534
+exits.
547 535
 
548
-    Example use:
536
+For example, when a container exits, its associated thin device is removed.
537
+If that device has leaked into some other mount namespace and can't be
538
+removed, the container exit still succeeds and this option causes the
539
+system to schedule the device for deferred removal. It does not wait in a
540
+loop trying to remove a busy device.
549 541
 
550
-    ```bash
551
-    $ sudo dockerd --storage-opt dm.use_deferred_removal=true
552
-    ```
542
+###### Example
553 543
 
554
-*   `dm.use_deferred_deletion`
544
+```bash
545
+$ sudo dockerd --storage-opt dm.use_deferred_removal=true
546
+```
555 547
 
556
-    Enables use of deferred device deletion for thin pool devices. By default,
557
-    thin pool device deletion is synchronous. Before a container is deleted,
558
-    the Docker daemon removes any associated devices. If the storage driver
559
-    can not remove a device, the container deletion fails and daemon returns.
548
+##### `dm.use_deferred_deletion`
560 549
 
561
-        Error deleting container: Error response from daemon: Cannot destroy container
550
+Enables use of deferred device deletion for thin pool devices. By default,
551
+thin pool device deletion is synchronous. Before a container is deleted,
552
+the Docker daemon removes any associated devices. If the storage driver
553
+can not remove a device, the container deletion fails and daemon returns.
562 554
 
563
-    To avoid this failure, enable both deferred device deletion and deferred
564
-    device removal on the daemon.
555
+```none
556
+Error deleting container: Error response from daemon: Cannot destroy container
557
+```
565 558
 
566
-    ```bash
567
-    $ sudo dockerd \
568
-          --storage-opt dm.use_deferred_deletion=true \
569
-          --storage-opt dm.use_deferred_removal=true
570
-    ```
559
+To avoid this failure, enable both deferred device deletion and deferred
560
+device removal on the daemon.
571 561
 
572
-    With these two options enabled, if a device is busy when the driver is
573
-    deleting a container, the driver marks the device as deleted. Later, when
574
-    the device isn't in use, the driver deletes it.
562
+```bash
563
+$ sudo dockerd \
564
+      --storage-opt dm.use_deferred_deletion=true \
565
+      --storage-opt dm.use_deferred_removal=true
566
+```
575 567
 
576
-    In general it should be safe to enable this option by default. It will help
577
-    when unintentional leaking of mount point happens across multiple mount
578
-    namespaces.
568
+With these two options enabled, if a device is busy when the driver is
569
+deleting a container, the driver marks the device as deleted. Later, when
570
+the device isn't in use, the driver deletes it.
579 571
 
580
-*   `dm.min_free_space`
572
+In general it should be safe to enable this option by default. It will help
573
+when unintentional leaking of mount point happens across multiple mount
574
+namespaces.
581 575
 
582
-    Specifies the min free space percent in a thin pool require for new device
583
-    creation to succeed. This check applies to both free data space as well
584
-    as free metadata space. Valid values are from 0% - 99%. Value 0% disables
585
-    free space checking logic. If user does not specify a value for this option,
586
-    the Engine uses a default value of 10%.
576
+##### `dm.min_free_space`
587 577
 
588
-    Whenever a new a thin pool device is created (during `docker pull` or during
589
-    container creation), the Engine checks if the minimum free space is
590
-    available. If sufficient space is unavailable, then device creation fails
591
-    and any relevant `docker` operation fails.
578
+Specifies the min free space percent in a thin pool require for new device
579
+creation to succeed. This check applies to both free data space as well
580
+as free metadata space. Valid values are from 0% - 99%. Value 0% disables
581
+free space checking logic. If user does not specify a value for this option,
582
+the Engine uses a default value of 10%.
592 583
 
593
-    To recover from this error, you must create more free space in the thin pool
594
-    to recover from the error. You can create free space by deleting some images
595
-    and containers from the thin pool. You can also add more storage to the thin
596
-    pool.
584
+Whenever a new a thin pool device is created (during `docker pull` or during
585
+container creation), the Engine checks if the minimum free space is
586
+available. If sufficient space is unavailable, then device creation fails
587
+and any relevant `docker` operation fails.
597 588
 
598
-    To add more space to a LVM (logical volume management) thin pool, just add
599
-    more storage to the volume group container thin pool; this should automatically
600
-    resolve any errors. If your configuration uses loop devices, then stop the
601
-    Engine daemon, grow the size of loop files and restart the daemon to resolve
602
-    the issue.
589
+To recover from this error, you must create more free space in the thin pool
590
+to recover from the error. You can create free space by deleting some images
591
+and containers from the thin pool. You can also add more storage to the thin
592
+pool.
603 593
 
604
-    Example use:
594
+To add more space to a LVM (logical volume management) thin pool, just add
595
+more storage to the volume group container thin pool; this should automatically
596
+resolve any errors. If your configuration uses loop devices, then stop the
597
+Engine daemon, grow the size of loop files and restart the daemon to resolve
598
+the issue.
605 599
 
606
-    ```bash
607
-    $ sudo dockerd --storage-opt dm.min_free_space=10%
608
-    ```
600
+###### Example
601
+
602
+```bash
603
+$ sudo dockerd --storage-opt dm.min_free_space=10%
604
+```
609 605
 
610
-*  `dm.xfs_nospace_max_retries`
606
+##### `dm.xfs_nospace_max_retries`
611 607
 
612
-    Specifies the maximum number of retries XFS should attempt to complete
613
-    IO when ENOSPC (no space) error is returned by underlying storage device.
608
+Specifies the maximum number of retries XFS should attempt to complete
609
+IO when ENOSPC (no space) error is returned by underlying storage device.
614 610
 
615
-    By default XFS retries infinitely for IO to finish and this can result
616
-    in unkillable process. To change this behavior one can set
617
-    xfs_nospace_max_retries to say 0 and XFS will not retry IO after getting
618
-    ENOSPC and will shutdown filesystem.
611
+By default XFS retries infinitely for IO to finish and this can result
612
+in unkillable process. To change this behavior one can set
613
+xfs_nospace_max_retries to say 0 and XFS will not retry IO after getting
614
+ENOSPC and will shutdown filesystem.
619 615
 
620
-    Example use:
616
+###### Example
621 617
 
622
-    ```bash
623
-    $ sudo dockerd --storage-opt dm.xfs_nospace_max_retries=0
624
-    ```
618
+```bash
619
+$ sudo dockerd --storage-opt dm.xfs_nospace_max_retries=0
620
+```
625 621
 
626 622
 #### ZFS options
627 623
 
628
-*   `zfs.fsname`
624
+##### `zfs.fsname`
629 625
 
630
-    Set zfs filesystem under which docker will create its own datasets.
631
-    By default docker will pick up the zfs filesystem where docker graph
632
-    (`/var/lib/docker`) is located.
626
+Set zfs filesystem under which docker will create its own datasets.
627
+By default docker will pick up the zfs filesystem where docker graph
628
+(`/var/lib/docker`) is located.
633 629
 
634
-    Example use:
630
+###### Example
635 631
 
636
-    ```bash
637
-    $ sudo dockerd -s zfs --storage-opt zfs.fsname=zroot/docker
638
-    ```
632
+```bash
633
+$ sudo dockerd -s zfs --storage-opt zfs.fsname=zroot/docker
634
+```
639 635
 
640 636
 #### Btrfs options
641 637
 
642
-*   `btrfs.min_space`
638
+##### `btrfs.min_space`
643 639
 
644
-    Specifies the minimum size to use when creating the subvolume which is used
645
-    for containers. If user uses disk quota for btrfs when creating or running
646
-    a container with **--storage-opt size** option, docker should ensure the
647
-    **size** cannot be smaller than **btrfs.min_space**.
640
+Specifies the minimum size to use when creating the subvolume which is used
641
+for containers. If user uses disk quota for btrfs when creating or running
642
+a container with **--storage-opt size** option, docker should ensure the
643
+**size** cannot be smaller than **btrfs.min_space**.
648 644
 
649
-    Example use:
645
+###### Example
650 646
 
651
-    ```bash
652
-    $ sudo dockerd -s btrfs --storage-opt btrfs.min_space=10G
653
-    ```
647
+```bash
648
+$ sudo dockerd -s btrfs --storage-opt btrfs.min_space=10G
649
+```
654 650
 
655 651
 #### Overlay2 options
656 652
 
657
-*   `overlay2.override_kernel_check`
653
+##### `overlay2.override_kernel_check`
658 654
 
659
-    Overrides the Linux kernel version check allowing overlay2. Support for
660
-    specifying multiple lower directories needed by overlay2 was added to the
661
-    Linux kernel in 4.0.0. However, some older kernel versions may be patched
662
-    to add multiple lower directory support for OverlayFS. This option should
663
-    only be used after verifying this support exists in the kernel. Applying
664
-    this option on a kernel without this support will cause failures on mount.
655
+Overrides the Linux kernel version check allowing overlay2. Support for
656
+specifying multiple lower directories needed by overlay2 was added to the
657
+Linux kernel in 4.0.0. However, some older kernel versions may be patched
658
+to add multiple lower directory support for OverlayFS. This option should
659
+only be used after verifying this support exists in the kernel. Applying
660
+this option on a kernel without this support will cause failures on mount.
665 661
 
666
-## Docker runtime execution options
662
+### Docker runtime execution options
667 663
 
668 664
 The Docker daemon relies on a
669 665
 [OCI](https://github.com/opencontainers/runtime-spec) compliant runtime
... ...
@@ -706,9 +706,9 @@ This is the same example via the command line:
706 706
 $ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-runc-replacement
707 707
 ```
708 708
 
709
-> **Note**: defining runtime arguments via the command line is not supported.
709
+> **Note**: Defining runtime arguments via the command line is not supported.
710 710
 
711
-## Options for the runtime
711
+#### Options for the runtime
712 712
 
713 713
 You can configure the runtime using options specified
714 714
 with the `--exec-opt` flag. All the flag's options have the `native` prefix. A
... ...
@@ -738,7 +738,7 @@ Will make `hyperv` the default isolation technology on Windows. If no isolation
738 738
 value is specified on daemon start, on Windows client, the default is
739 739
 `hyperv`, and on Windows server, the default is `process`.
740 740
 
741
-## Daemon DNS options
741
+#### Daemon DNS options
742 742
 
743 743
 To set the DNS server for all Docker containers, use:
744 744
 
... ...
@@ -753,8 +753,7 @@ To set the DNS search domain for all Docker containers, use:
753 753
 $ sudo dockerd --dns-search example.com
754 754
 ```
755 755
 
756
-
757
-## Insecure registries
756
+#### Insecure registries
758 757
 
759 758
 Docker considers a private registry either secure or insecure. In the rest of
760 759
 this section, *registry* is used for *private registry*, and `myregistry:5000`
... ...
@@ -798,11 +797,11 @@ because its use creates security vulnerabilities it should ONLY be enabled for
798 798
 testing purposes.  For increased security, users should add their CA to their
799 799
 system's list of trusted CAs instead of enabling `--insecure-registry`.
800 800
 
801
-## Legacy Registries
801
+##### Legacy Registries
802 802
 
803 803
 Enabling `--disable-legacy-registry` forces a docker daemon to only interact with registries which support the V2 protocol.  Specifically, the daemon will not attempt `push`, `pull` and `login` to v1 registries.  The exception to this is `search` which can still be performed on v1 registries.
804 804
 
805
-## Running a Docker daemon behind an HTTPS_PROXY
805
+#### Running a Docker daemon behind an HTTPS_PROXY
806 806
 
807 807
 When running inside a LAN that uses an `HTTPS` proxy, the Docker Hub
808 808
 certificates will be replaced by the proxy's certificates. These certificates
... ...
@@ -819,7 +818,7 @@ This will only add the proxy and authentication to the Docker daemon's requests
819 819
 your `docker build`s and running containers will need extra configuration to
820 820
 use the proxy
821 821
 
822
-## Default Ulimits
822
+#### Default `ulimit` settings
823 823
 
824 824
 `--default-ulimit` allows you to set the default `ulimit` options to use for
825 825
 all containers. It takes the same options as `--ulimit` for `docker run`. If
... ...
@@ -831,7 +830,7 @@ Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linu
831 831
 set the maximum number of processes available to a user, not to a container. For details
832 832
 please check the [run](run.md) reference.
833 833
 
834
-## Nodes discovery
834
+#### Node discovery
835 835
 
836 836
 The `--cluster-advertise` option specifies the `host:port` or `interface:port`
837 837
 combination that this particular daemon instance should use when advertising
... ...
@@ -857,39 +856,16 @@ $ sudo dockerd \
857 857
 
858 858
 The currently supported cluster store options are:
859 859
 
860
-*   `discovery.heartbeat`
861
-
862
-    Specifies the heartbeat timer in seconds which is used by the daemon as a
863
-    keepalive mechanism to make sure discovery module treats the node as alive
864
-    in the cluster. If not configured, the default value is 20 seconds.
865
-
866
-*   `discovery.ttl`
867
-
868
-    Specifies the ttl (time-to-live) in seconds which is used by the discovery
869
-    module to timeout a node if a valid heartbeat is not received within the
870
-    configured ttl value. If not configured, the default value is 60 seconds.
871
-
872
-*   `kv.cacertfile`
860
+| Option                | Description |
861
+|-----------------------|-------------|
862
+| `discovery.heartbeat` | Specifies the heartbeat timer in seconds which is used by the daemon as a `keepalive` mechanism to make sure discovery module treats the node as alive in the cluster. If not configured, the default value is 20 seconds. |
863
+| `discovery.ttl`       | Specifies the TTL (time-to-live) in seconds which is used by the discovery module to timeout a node if a valid heartbeat is not received within the configured ttl value. If not configured, the default value is 60 seconds. |
864
+| `kv.cacertfile`       | Specifies the path to a local file with PEM encoded CA certificates to trust. |
865
+| `kv.certfile`         | Specifies the path to a local file with a PEM encoded certificate. This certificate is used as the client cert for communication with the Key/Value store. |
866
+| `kv.keyfile`          | Specifies the path to a local file with a PEM encoded private key. This private key is used as the client key for communication with the Key/Value store. |
867
+| `kv.path`             | Specifies the path in the Key/Value store. If not configured, the default value is 'docker/nodes'. |
873 868
 
874
-    Specifies the path to a local file with PEM encoded CA certificates to trust
875
-
876
-*   `kv.certfile`
877
-
878
-    Specifies the path to a local file with a PEM encoded certificate.  This
879
-    certificate is used as the client cert for communication with the
880
-    Key/Value store.
881
-
882
-*   `kv.keyfile`
883
-
884
-    Specifies the path to a local file with a PEM encoded private key.  This
885
-    private key is used as the client key for communication with the
886
-    Key/Value store.
887
-
888
-*   `kv.path`
889
-
890
-    Specifies the path in the Key/Value store. If not configured, the default value is 'docker/nodes'.
891
-
892
-## Access authorization
869
+#### Access authorization
893 870
 
894 871
 Docker's access authorization can be extended by authorization plugins that your
895 872
 organization can purchase or build themselves. You can install one or more
... ...
@@ -914,7 +890,7 @@ For information about how to create an authorization plugin, see [authorization
914 914
 plugin](../../extend/plugins_authorization.md) section in the Docker extend section of this documentation.
915 915
 
916 916
 
917
-## Daemon user namespace options
917
+#### Daemon user namespace options
918 918
 
919 919
 The Linux kernel [user namespace support](http://man7.org/linux/man-pages/man7/user_namespaces.7.html) provides additional security by enabling
920 920
 a process, and therefore a container, to have a unique range of user and
... ...
@@ -947,7 +923,7 @@ and provided subordinate uid and gid ranges. This default user will be named
947 947
 > pull`, `docker push`, and container startup as users expect with
948 948
 > user namespaces disabled.
949 949
 
950
-### Starting the daemon with user namespaces enabled
950
+##### Start the daemon with user namespaces enabled
951 951
 
952 952
 To enable user namespace support, start the daemon with the
953 953
 `--userns-remap` flag, which accepts values in the following formats:
... ...
@@ -994,7 +970,7 @@ with user namespaces enabled or not. If the daemon is configured with user
994 994
 namespaces, the Security Options entry in the response will list "userns" as
995 995
 one of the enabled security features.
996 996
 
997
-#### Behavior differences when user namespaces are enabled
997
+##### Behavior differences when user namespaces are enabled
998 998
 
999 999
 When you start the Docker daemon with `--userns-remap`, Docker segregates the graph directory
1000 1000
 where the images are stored by adding an extra directory with a name corresponding to the
... ...
@@ -1007,7 +983,7 @@ images and container layers, are also owned by the new UID and GID. To set the o
1007 1007
 correctly, you need to re-pull the images and restart the containers after starting the
1008 1008
 daemon with `--userns-remap`.
1009 1009
 
1010
-### Detailed information on `subuid`/`subgid` ranges
1010
+##### Detailed information on `subuid`/`subgid` ranges
1011 1011
 
1012 1012
 Given potential advanced use of the subordinate ID ranges by power users, the
1013 1013
 following paragraphs define how the Docker daemon currently uses the range entries
... ...
@@ -1030,7 +1006,7 @@ following algorithm to create the mapping ranges:
1030 1030
 2. Map segments will be created from each range in increasing value with a length matching the length of each segment. Therefore the range segment with the lowest numeric starting value will be equal to the remapped root, and continue up through host uid/gid equal to the range segment length. As an example, if the lowest segment starts at ID 1000 and has a length of 100, then a map of 1000 -> 0 (the remapped root) up through 1100 -> 100 will be created from this segment. If the next segment starts at ID 10000, then the next map will start with mapping 10000 -> 101 up to the length of this second segment. This will continue until no more segments are found in the subordinate files for this user.
1031 1031
 3. If more than five range segments exist for a single user, only the first five will be utilized, matching the kernel's limitation of only five entries in `/proc/self/uid_map` and `proc/self/gid_map`.
1032 1032
 
1033
-### Disable user namespace for a container
1033
+##### Disable user namespace for a container
1034 1034
 
1035 1035
 If you enable user namespaces on the daemon, all containers are started
1036 1036
 with user namespaces enabled. In some situations you might want to disable
... ...
@@ -1040,7 +1016,7 @@ To enable those advanced features for a specific container use `--userns=host`
1040 1040
 in the `run/exec/create` command.
1041 1041
 This option will completely disable user namespace mapping for the container's user.
1042 1042
 
1043
-### User namespace known restrictions
1043
+##### User namespace known restrictions
1044 1044
 
1045 1045
 The following standard Docker features are currently incompatible when
1046 1046
 running a Docker daemon with user namespaces enabled:
... ...
@@ -1063,7 +1039,7 @@ process. The most notable restriction that we are aware of at this time is the
1063 1063
 inability to use `mknod`. Permission will be denied for device creation even as
1064 1064
 container `root` inside a user namespace.
1065 1065
 
1066
-## Miscellaneous options
1066
+### Miscellaneous options
1067 1067
 
1068 1068
 IP masquerading uses address translation to allow containers without a public
1069 1069
 IP to talk to other machines on the Internet. This may interfere with some
... ...
@@ -1078,7 +1054,7 @@ set like this:
1078 1078
     export DOCKER_TMPDIR=/mnt/disk2/tmp
1079 1079
     /usr/local/bin/dockerd -D -g /var/lib/docker -H unix:// > /var/lib/docker-machine/docker.log 2>&1
1080 1080
 
1081
-## Default cgroup parent
1081
+#### Default cgroup parent
1082 1082
 
1083 1083
 The `--cgroup-parent` option allows you to set the default cgroup parent
1084 1084
 to use for containers. If this option is not set, it defaults to `/docker` for
... ...
@@ -1105,7 +1081,7 @@ This setting can also be set per container, using the `--cgroup-parent`
1105 1105
 option on `docker create` and `docker run`, and takes precedence over
1106 1106
 the `--cgroup-parent` option on the daemon.
1107 1107
 
1108
-## Daemon Metrics
1108
+#### Daemon metrics
1109 1109
 
1110 1110
 The `--metrics-addr` option takes a tcp address to serve the metrics API.
1111 1111
 This feature is still experimental, therefore, the daemon must be running in experimental
... ...
@@ -1119,7 +1095,7 @@ If you are running a prometheus server you can add this address to your scrape c
1119 1119
 to have prometheus collect metrics on Docker.  For more information
1120 1120
 on prometheus you can view the website [here](https://prometheus.io/).
1121 1121
 
1122
-```yml
1122
+```none
1123 1123
 scrape_configs:
1124 1124
   - job_name: 'docker'
1125 1125
     static_configs:
... ...
@@ -1130,7 +1106,7 @@ Please note that this feature is still marked as experimental as metrics and met
1130 1130
 names could change while this feature is still in experimental.  Please provide
1131 1131
 feedback on what you would like to see collected in the API.
1132 1132
 
1133
-## Daemon configuration file
1133
+#### Daemon configuration file
1134 1134
 
1135 1135
 The `--config-file` option allows you to set any configuration option
1136 1136
 for the daemon in a JSON format. This file uses the same flag names as keys,
... ...
@@ -1145,7 +1121,7 @@ For example, the daemon fails to start if you set daemon labels
1145 1145
 in the configuration file and also set daemon labels via the `--label` flag.
1146 1146
 Options that are not present in the file are ignored when the daemon starts.
1147 1147
 
1148
-### Linux configuration file
1148
+##### On Linux
1149 1149
 
1150 1150
 The default location of the configuration file on Linux is
1151 1151
 `/etc/docker/daemon.json`. The `--config-file` flag can be used to specify a
... ...
@@ -1229,7 +1205,7 @@ This is a full example of the allowed configuration options on Linux:
1229 1229
 }
1230 1230
 ```
1231 1231
 
1232
-### Windows configuration file
1232
+##### On Windows
1233 1233
 
1234 1234
 The default location of the configuration file on Windows is
1235 1235
  `%programdata%\docker\config\daemon.json`. The `--config-file` flag can be
... ...
@@ -1276,7 +1252,7 @@ This is a full example of the allowed configuration options on Windows:
1276 1276
 }
1277 1277
 ```
1278 1278
 
1279
-### Configuration reloading
1279
+#### Configuration reload behavior
1280 1280
 
1281 1281
 Some options can be reconfigured when the daemon is running without requiring
1282 1282
 to restart the process. We use the `SIGHUP` signal in Linux to reload, and a global event
... ...
@@ -1312,7 +1288,7 @@ Configuration reload will log a warning message if it detects a change in
1312 1312
 previously configured cluster configurations.
1313 1313
 
1314 1314
 
1315
-## Running multiple daemons
1315
+### Run multiple daemons
1316 1316
 
1317 1317
 > **Note:** Running multiple daemons on a single host is considered as "experimental". The user should be aware of
1318 1318
 > unsolved problems. This solution may not work properly in some cases. Solutions are currently under development
... ...
@@ -1325,7 +1301,7 @@ by providing them as flags, or by using a [daemon configuration file](#daemon-co
1325 1325
 
1326 1326
 The following daemon options must be configured for each daemon:
1327 1327
 
1328
-```bash
1328
+```none
1329 1329
 -b, --bridge=                          Attach containers to a network bridge
1330 1330
 --exec-root=/var/run/docker            Root of the Docker execdriver
1331 1331
 -g, --graph=/var/lib/docker            Root of the Docker runtime
... ...
@@ -28,29 +28,90 @@ Options:
28 28
       --until string   Stream events until this timestamp
29 29
 ```
30 30
 
31
+## Description
32
+
33
+Use `docker events` to get real-time events from the server. These events differ
34
+per Docker object type.
35
+
36
+### Object types
37
+
38
+#### Containers
39
+
31 40
 Docker containers report the following events:
32 41
 
33
-    attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, health_status, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update
42
+- `attach`
43
+- `commit`
44
+- `copy`
45
+- `create`
46
+- `destroy`
47
+- `detach`
48
+- `die`
49
+- `exec_create`
50
+- `exec_detach`
51
+- `exec_start`
52
+- `export`
53
+- `health_status`
54
+- `kill`
55
+- `oom`
56
+- `pause`
57
+- `rename`
58
+- `resize`
59
+- `restart`
60
+- `start`
61
+- `stop`
62
+- `top`
63
+- `unpause`
64
+- `update`
65
+
66
+#### Images
34 67
 
35 68
 Docker images report the following events:
36 69
 
37
-    delete, import, load, pull, push, save, tag, untag
70
+- `delete`
71
+- `import`
72
+- `load`
73
+- `pull`
74
+- `push`
75
+- `save`
76
+- `tag`
77
+- `untag`
78
+
79
+#### Plugins
38 80
 
39 81
 Docker plugins report the following events:
40 82
 
41
-    install, enable, disable, remove
83
+- `install`
84
+- `enable`
85
+- `disable`
86
+- `remove`
87
+
88
+#### Volumes
42 89
 
43 90
 Docker volumes report the following events:
44 91
 
45
-    create, mount, unmount, destroy
92
+- `create`
93
+- `mount`
94
+- `unmount`
95
+- `destroy`
96
+
97
+#### Networks
46 98
 
47 99
 Docker networks report the following events:
48 100
 
49
-    create, connect, disconnect, destroy
101
+- `create`
102
+- `connect`
103
+- `disconnect`
104
+- `destroy`
50 105
 
51
-Docker daemon reports the following events:
106
+#### Daemons
52 107
 
53
-    reload
108
+Docker daemons report the following events:
109
+
110
+- `reload`
111
+
112
+### Limiting, filtering, and formatting the output
113
+
114
+#### Limit events by time
54 115
 
55 116
 The `--since` and `--until` parameters can be Unix timestamps, date formatted
56 117
 timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
... ...
@@ -65,7 +126,7 @@ that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
65 65
 seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
66 66
 fraction of a second no more than nine digits long.
67 67
 
68
-## Filtering
68
+#### Filtering
69 69
 
70 70
 The filtering flag (`-f` or `--filter`) format is of "key=value". If you would
71 71
 like to use multiple filters, pass multiple flags (e.g.,
... ...
@@ -91,7 +152,7 @@ The currently supported filters are:
91 91
 * type (`type=<container or image or volume or network or daemon>`)
92 92
 * volume (`volume=<name or id>`)
93 93
 
94
-## Format
94
+#### Format
95 95
 
96 96
 If a format (`--format`) is specified, the given template will be executed
97 97
 instead of the default
... ...
@@ -103,132 +164,190 @@ Lines. For information about JSON Lines, please refer to http://jsonlines.org/ .
103 103
 
104 104
 ## Examples
105 105
 
106
+### Basic example
107
+
106 108
 You'll need two shells for this example.
107 109
 
108 110
 **Shell 1: Listening for events:**
109 111
 
110
-    $ docker events
112
+```bash
113
+$ docker events
114
+```
111 115
 
112 116
 **Shell 2: Start and Stop containers:**
113 117
 
114
-    $ docker create --name test alpine:latest top
115
-    $ docker start test
116
-    $ docker stop test
118
+```bash
119
+$ docker create --name test alpine:latest top
120
+$ docker start test
121
+$ docker stop test
122
+```
117 123
 
118 124
 **Shell 1: (Again .. now showing events):**
119 125
 
120
-    2017-01-05T00:35:58.859401177+08:00 container create 0fdb48addc82871eb34eb23a847cfd033dedd1a0a37bef2e6d9eb3870fc7ff37 (image=alpine:latest, name=test)
121
-    2017-01-05T00:36:04.703631903+08:00 network connect e2e1f5ceda09d4300f3a846f0acfaa9a8bb0d89e775eb744c5acecd60e0529e2 (container=0fdb...ff37, name=bridge, type=bridge)
122
-    2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
123
-    2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
124
-    2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
125
-    2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
126
-    2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
127
-
128
-**Show events in the past from a specified time:**
129
-
130
-    $ docker events --since 1483283804
131
-    2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
132
-    2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
133
-    2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
134
-    2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
135
-    2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
136
-    2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
137
-    2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
138
-    2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
139
-
140
-    $ docker events --since '2017-01-05'
141
-    2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
142
-    2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
143
-    2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
144
-    2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
145
-    2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
146
-    2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
147
-    2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
148
-    2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
149
-
150
-    $ docker events --since '2013-09-03T15:49:29'
151
-    2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
152
-    2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
153
-    2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
154
-    2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
155
-    2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
156
-    2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
157
-    2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
158
-    2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
159
-
160
-This example outputs all events that were generated in the last 3 minutes,
161
-relative to the current time on the client machine:
162
-
163
-    $ docker events --since '10m'
164
-    2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
165
-    2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
166
-    2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
167
-    2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
168
-    2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
169
-    2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
170
-    2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
171
-    2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
172
-
173
-**Filter events:**
174
-
175
-    $ docker events --filter 'event=stop'
176
-    2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
177
-    2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain)
178
-
179
-    $ docker events --filter 'image=alpine'
180
-    2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner)
181
-    2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner)
182
-    2017-01-05T00:42:01.106875249+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=15)
183
-    2017-01-05T00:42:11.111934041+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=9)
184
-    2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner)
185
-    2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner)
186
-
187
-    $ docker events --filter 'container=test'
188
-    2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
189
-    2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
190
-    2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
191
-    2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
192
-
193
-    $ docker events --filter 'container=test' --filter 'container=d9cdb1525ea8'
194
-    2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
195
-    2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner)
196
-    2017-01-05T00:44:29.757658470+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=9)
197
-    2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test)
198
-    2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test)
199
-
200
-    $ docker events --filter 'container=test' --filter 'event=stop'
201
-    2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test)
202
-
203
-    $ docker events --filter 'type=volume'
204
-    2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local)
205
-    2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate)
206
-    2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local)
207
-    2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local)
208
-
209
-    $ docker events --filter 'type=network'
210
-    2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge)
211
-    2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge)
212
-
213
-    $ docker events --filter 'type=plugin' (experimental)
214
-    2016-07-25T17:30:14.825557616Z plugin pull ec7b...993f (name=tiborvass/sample-volume-plugin:latest)
215
-    2016-07-25T17:30:14.888127370Z plugin enable ec7b...993f (name=tiborvass/sample-volume-plugin:latest)
216
-
217
-**Format:**
218
-
219
-    $ docker events --filter 'type=container' --format 'Type={{.Type}}  Status={{.Status}}  ID={{.ID}}'
220
-    Type=container  Status=create  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
221
-    Type=container  Status=attach  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
222
-    Type=container  Status=start  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
223
-    Type=container  Status=resize  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
224
-    Type=container  Status=die  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
225
-    Type=container  Status=destroy  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
226
-
227
-**Format (as JSON Lines):**
126
+```none
127
+2017-01-05T00:35:58.859401177+08:00 container create 0fdb48addc82871eb34eb23a847cfd033dedd1a0a37bef2e6d9eb3870fc7ff37 (image=alpine:latest, name=test)
128
+2017-01-05T00:36:04.703631903+08:00 network connect e2e1f5ceda09d4300f3a846f0acfaa9a8bb0d89e775eb744c5acecd60e0529e2 (container=0fdb...ff37, name=bridge, type=bridge)
129
+2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
130
+2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
131
+2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
132
+2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
133
+2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
134
+```
135
+
136
+To exit the `docker events` command, use `CTRL+C`.
137
+
138
+### Filter events by time
139
+
140
+You can filter the output by an absolute timestamp or relative time on the host
141
+machine, using the following different time syntaxes:
142
+
143
+```bash
144
+$ docker events --since 1483283804
145
+2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
146
+2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
147
+2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
148
+2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
149
+2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
150
+2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
151
+2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
152
+2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
153
+
154
+$ docker events --since '2017-01-05'
155
+2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
156
+2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
157
+2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
158
+2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
159
+2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
160
+2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
161
+2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
162
+2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
163
+
164
+$ docker events --since '2013-09-03T15:49:29'
165
+2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
166
+2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
167
+2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
168
+2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
169
+2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
170
+2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
171
+2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
172
+2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
173
+
174
+$ docker events --since '10m'
175
+2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
176
+2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
177
+2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
178
+2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
179
+2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
180
+2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
181
+2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
182
+2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
183
+```
184
+
185
+### Filter events by criteria
186
+
187
+The following commands show several different ways to filter the `docker event`
188
+output.
189
+
190
+```bash
191
+$ docker events --filter 'event=stop'
192
+
193
+2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
194
+2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain)
195
+
196
+$ docker events --filter 'image=alpine'
197
+
198
+2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner)
199
+2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner)
200
+2017-01-05T00:42:01.106875249+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=15)
201
+2017-01-05T00:42:11.111934041+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=9)
202
+2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner)
203
+2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner)
204
+
205
+$ docker events --filter 'container=test'
206
+
207
+2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
208
+2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
209
+2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
210
+2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
211
+
212
+$ docker events --filter 'container=test' --filter 'container=d9cdb1525ea8'
228 213
 
214
+2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
215
+2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner)
216
+2017-01-05T00:44:29.757658470+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=9)
217
+2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test)
218
+2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test)
219
+
220
+$ docker events --filter 'container=test' --filter 'event=stop'
221
+
222
+2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test)
223
+
224
+$ docker events --filter 'type=volume'
225
+
226
+2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local)
227
+2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate)
228
+2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local)
229
+2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local)
230
+
231
+$ docker events --filter 'type=network'
232
+
233
+2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge)
234
+2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge)
235
+
236
+$ docker events --filter 'container=container_1' --filter 'container=container_2'
237
+
238
+2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
239
+2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
240
+2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8)
241
+2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
242
+
243
+$ docker events --filter 'type=volume'
244
+
245
+2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local)
246
+2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate)
247
+2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local)
248
+2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local)
249
+
250
+$ docker events --filter 'type=network'
251
+
252
+2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge)
253
+2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge)
254
+```
255
+
256
+The `type=plugin` filter is experimental.
257
+
258
+```bash
259
+$ docker events --filter 'type=plugin'
260
+
261
+2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
262
+2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
263
+```
264
+
265
+### Format the output
266
+
267
+```bash
268
+{% raw %}
269
+$ docker events --filter 'type=container' --format 'Type={{.Type}}  Status={{.Status}}  ID={{.ID}}'
270
+
271
+Type=container  Status=create  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
272
+Type=container  Status=attach  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
273
+Type=container  Status=start  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
274
+Type=container  Status=resize  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
275
+Type=container  Status=die  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
276
+Type=container  Status=destroy  ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26
277
+{% endraw %}
278
+```
279
+
280
+#### Format as JSON
281
+
282
+```none
283
+{% raw %}
229 284
     $ docker events --format '{{json .}}'
285
+
230 286
     {"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
231 287
     {"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
232 288
     {"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e..
233 289
     {"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42..
234 290
     {"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
291
+{% endraw %}
292
+```
... ...
@@ -31,35 +31,61 @@ Options:
31 31
   -u, --user           Username or UID (format: <name|uid>[:<group|gid>])
32 32
 ```
33 33
 
34
+## Descriptino
35
+
34 36
 The `docker exec` command runs a new command in a running container.
35 37
 
36 38
 The command started using `docker exec` only runs while the container's primary
37 39
 process (`PID 1`) is running, and it is not restarted if the container is
38 40
 restarted.
39 41
 
40
-If the container is paused, then the `docker exec` command will fail with an error:
42
+## Examples
41 43
 
42
-    $ docker pause test
43
-    test
44
-    $ docker ps
45
-    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                   PORTS               NAMES
46
-    1ae3b36715d2        ubuntu:latest       "bash"              17 seconds ago      Up 16 seconds (Paused)                       test
47
-    $ docker exec test ls
48
-    FATA[0000] Error response from daemon: Container test is paused, unpause the container before exec
49
-    $ echo $?
50
-    1
44
+### Run `docker exec` on a running container
51 45
 
52
-## Examples
46
+First, start a container.
53 47
 
54
-    $ docker run --name ubuntu_bash --rm -i -t ubuntu bash
48
+```bash
49
+$ docker run --name ubuntu_bash --rm -i -t ubuntu bash
50
+```
55 51
 
56 52
 This will create a container named `ubuntu_bash` and start a Bash session.
57 53
 
58
-    $ docker exec -d ubuntu_bash touch /tmp/execWorks
54
+Next, execute a command on the container.
55
+
56
+```bash
57
+$ docker exec -d ubuntu_bash touch /tmp/execWorks
58
+```
59 59
 
60 60
 This will create a new file `/tmp/execWorks` inside the running container
61 61
 `ubuntu_bash`, in the background.
62 62
 
63
-    $ docker exec -it ubuntu_bash bash
63
+Next, execute an interactive `bash` shell on the container.
64
+
65
+```bash
66
+$ docker exec -it ubuntu_bash bash
67
+```
64 68
 
65 69
 This will create a new Bash session in the container `ubuntu_bash`.
70
+
71
+### Try to run `docker exec` on a paused container
72
+
73
+If the container is paused, then the `docker exec` command will fail with an error:
74
+
75
+```bash
76
+$ docker pause test
77
+
78
+test
79
+
80
+$ docker ps
81
+
82
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                   PORTS               NAMES
83
+1ae3b36715d2        ubuntu:latest       "bash"              17 seconds ago      Up 16 seconds (Paused)                       test
84
+
85
+$ docker exec test ls
86
+
87
+FATA[0000] Error response from daemon: Container test is paused, unpause the container before exec
88
+
89
+$ echo $?
90
+1
91
+```
... ...
@@ -25,19 +25,24 @@ Options:
25 25
   -o, --output string   Write to a file, instead of STDOUT
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 The `docker export` command does not export the contents of volumes associated
29 31
 with the container. If a volume is mounted on top of an existing directory in
30 32
 the container, `docker export` will export the contents of the *underlying*
31 33
 directory, not the contents of the volume.
32 34
 
33
-Refer to [Backup, restore, or migrate data
34
-volumes](https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes) in
35
-the user guide for examples on exporting data in a volume.
35
+Refer to [Backup, restore, or migrate data volumes](https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes)
36
+in the user guide for examples on exporting data in a volume.
36 37
 
37 38
 ## Examples
38 39
 
39
-    $ docker export red_panda > latest.tar
40
+Each of these commands has the same result.
40 41
 
41
-Or
42
+```bash
43
+$ docker export red_panda > latest.tar
44
+```
42 45
 
43
-    $ docker export --output="latest.tar" red_panda
46
+```bash
47
+$ docker export --output="latest.tar" red_panda
48
+```
... ...
@@ -27,22 +27,30 @@ Options:
27 27
   -q, --quiet      Only show numeric IDs
28 28
 ```
29 29
 
30
+
31
+## Examples
32
+
30 33
 To see how the `docker:latest` image was built:
31 34
 
32
-    $ docker history docker
33
-    IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
34
-    3e23a5875458        8 days ago          /bin/sh -c #(nop) ENV LC_ALL=C.UTF-8            0 B
35
-    8578938dd170        8 days ago          /bin/sh -c dpkg-reconfigure locales &&    loc   1.245 MB
36
-    be51b77efb42        8 days ago          /bin/sh -c apt-get update && apt-get install    338.3 MB
37
-    4b137612be55        6 weeks ago         /bin/sh -c #(nop) ADD jessie.tar.xz in /        121 MB
38
-    750d58736b4b        6 weeks ago         /bin/sh -c #(nop) MAINTAINER Tianon Gravi <ad   0 B
39
-    511136ea3c5a        9 months ago                                                        0 B                 Imported from -
35
+```bash
36
+$ docker history docker
37
+
38
+IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
39
+3e23a5875458        8 days ago          /bin/sh -c #(nop) ENV LC_ALL=C.UTF-8            0 B
40
+8578938dd170        8 days ago          /bin/sh -c dpkg-reconfigure locales &&    loc   1.245 MB
41
+be51b77efb42        8 days ago          /bin/sh -c apt-get update && apt-get install    338.3 MB
42
+4b137612be55        6 weeks ago         /bin/sh -c #(nop) ADD jessie.tar.xz in /        121 MB
43
+750d58736b4b        6 weeks ago         /bin/sh -c #(nop) MAINTAINER Tianon Gravi <ad   0 B
44
+511136ea3c5a        9 months ago                                                        0 B                 Imported from -
45
+```
40 46
 
41 47
 To see how the `docker:apache` image was added to a container's base image:
42 48
 
43
-    $ docker history docker:scm
44
-    IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
45
-    2ac9d1098bf1        3 months ago        /bin/bash                                       241.4 MB            Added Apache to Fedora base image
46
-    88b42ffd1f7c        5 months ago        /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7   373.7 MB
47
-    c69cab00d6ef        5 months ago        /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar   0 B
48
-    511136ea3c5a        19 months ago                                                       0 B                 Imported from -
49
+```bash
50
+$ docker history docker:scm
51
+IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
52
+2ac9d1098bf1        3 months ago        /bin/bash                                       241.4 MB            Added Apache to Fedora base image
53
+88b42ffd1f7c        5 months ago        /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7   373.7 MB
54
+c69cab00d6ef        5 months ago        /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar   0 B
55
+511136ea3c5a        19 months ago                                                       0 B                 Imported from -
56
+```
... ...
@@ -26,12 +26,17 @@ Options:
26 26
       --help    Print usage
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 Remove all dangling images. If `-a` is specified, will also remove all images not referenced by any container.
30 32
 
33
+## Examples
34
+
31 35
 Example output:
32 36
 
33 37
 ```bash
34 38
 $ docker image prune -a
39
+
35 40
 WARNING! This will remove all images without at least one container associated to them.
36 41
 Are you sure you want to continue? [y/N] y
37 42
 Deleted Images:
... ...
@@ -62,7 +67,97 @@ deleted: sha256:2c675ee9ed53425e31a13e3390bf3f539bf8637000e4bcfbb85ee03ef4d910a1
62 62
 Total reclaimed space: 16.43 MB
63 63
 ```
64 64
 
65
-## Related information
65
+### Filtering
66
+
67
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
68
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
69
+
70
+The currently supported filters are:
71
+
72
+* until (`<timestamp>`) - only remove images created before given timestamp
73
+
74
+The `until` filter can be Unix timestamps, date formatted
75
+timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
76
+relative to the daemon machine’s time. Supported formats for date
77
+formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
78
+`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
79
+timezone on the daemon will be used if you do not provide either a `Z` or a
80
+`+-00:00` timezone offset at the end of the timestamp.  When providing Unix
81
+timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
82
+that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
83
+seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
84
+fraction of a second no more than nine digits long.
85
+
86
+The following removes images created before `2017-01-04T00:00:00`:
87
+
88
+```bash
89
+{% raw %}
90
+$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
91
+REPOSITORY          TAG                 IMAGE ID            CREATED AT                      SIZE
92
+foo                 latest              2f287ac753da        2017-01-04 13:42:23 -0800 PST   3.98 MB
93
+alpine              latest              88e169ea8f46        2016-12-27 10:17:25 -0800 PST   3.98 MB
94
+busybox             latest              e02e811dd08f        2016-10-07 14:03:58 -0700 PDT   1.09 MB
95
+
96
+$ docker image prune -a --force --filter "until=2017-01-04T00:00:00"
97
+
98
+Deleted Images:
99
+untagged: alpine:latest
100
+untagged: alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
101
+untagged: busybox:latest
102
+untagged: busybox@sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
103
+deleted: sha256:e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba
104
+deleted: sha256:e88b3f82283bc59d5e0df427c824e9f95557e661fcb0ea15fb0fb6f97760f9d9
105
+
106
+Total reclaimed space: 1.093 MB
107
+
108
+$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
109
+
110
+REPOSITORY          TAG                 IMAGE ID            CREATED AT                      SIZE
111
+foo                 latest              2f287ac753da        2017-01-04 13:42:23 -0800 PST   3.98 MB
112
+{% endraw %}
113
+```
114
+
115
+The following removes images created more than 10 days (`240h`) ago:
116
+
117
+```bash
118
+$ docker images
119
+
120
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
121
+foo                 latest              2f287ac753da        14 seconds ago      3.98 MB
122
+alpine              latest              88e169ea8f46        8 days ago          3.98 MB
123
+debian              jessie              7b0a06c805e8        2 months ago        123 MB
124
+busybox             latest              e02e811dd08f        2 months ago        1.09 MB
125
+golang              1.7.0               138c2e655421        4 months ago        670 MB
126
+
127
+$ docker image prune -a --force --filter "until=240h"
128
+
129
+Deleted Images:
130
+untagged: golang:1.7.0
131
+untagged: golang@sha256:6765038c2b8f407fd6e3ecea043b44580c229ccfa2a13f6d85866cf2b4a9628e
132
+deleted: sha256:138c2e6554219de65614d88c15521bfb2da674cbb0bf840de161f89ff4264b96
133
+deleted: sha256:ec353c2e1a673f456c4b78906d0d77f9d9456cfb5229b78c6a960bfb7496b76a
134
+deleted: sha256:fe22765feaf3907526b4921c73ea6643ff9e334497c9b7e177972cf22f68ee93
135
+deleted: sha256:ff845959c80148421a5c3ae11cc0e6c115f950c89bc949646be55ed18d6a2912
136
+deleted: sha256:a4320831346648c03db64149eafc83092e2b34ab50ca6e8c13112388f25899a7
137
+deleted: sha256:4c76020202ee1d9709e703b7c6de367b325139e74eebd6b55b30a63c196abaf3
138
+deleted: sha256:d7afd92fb07236c8a2045715a86b7d5f0066cef025018cd3ca9a45498c51d1d6
139
+deleted: sha256:9e63c5bce4585dd7038d830a1f1f4e44cb1a1515b00e620ac718e934b484c938
140
+untagged: debian:jessie
141
+untagged: debian@sha256:c1af755d300d0c65bb1194d24bce561d70c98a54fb5ce5b1693beb4f7988272f
142
+deleted: sha256:7b0a06c805e8f23807fb8856621c60851727e85c7bcb751012c813f122734c8d
143
+deleted: sha256:f96222d75c5563900bc4dd852179b720a0885de8f7a0619ba0ac76e92542bbc8
144
+
145
+Total reclaimed space: 792.6 MB
146
+
147
+$ docker images
148
+
149
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
150
+foo                 latest              2f287ac753da        About a minute ago   3.98 MB
151
+alpine              latest              88e169ea8f46        8 days ago           3.98 MB
152
+busybox             latest              e02e811dd08f        2 months ago         1.09 MB
153
+```
154
+
155
+## Related commands
66 156
 
67 157
 * [system df](system_df.md)
68 158
 * [container prune](container_prune.md)
... ...
@@ -35,6 +35,8 @@ Options:
35 35
   -q, --quiet           Only show numeric IDs
36 36
 ```
37 37
 
38
+## Description
39
+
38 40
 The default `docker images` will show all top level
39 41
 images, their repository and tags, and their size.
40 42
 
... ...
@@ -51,21 +53,26 @@ An image will be listed more than once if it has multiple repository names
51 51
 or tags. This single image (identifiable by its matching `IMAGE ID`)
52 52
 uses up the `SIZE` listed only once.
53 53
 
54
-### Listing the most recently created images
54
+## Examples
55 55
 
56
-    $ docker images
57
-    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
58
-    <none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB
59
-    committ                   latest              b6fa739cedf5        19 hours ago        1.089 GB
60
-    <none>                    <none>              78a85c484f71        19 hours ago        1.089 GB
61
-    docker                    latest              30557a29d5ab        20 hours ago        1.089 GB
62
-    <none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB
63
-    postgres                  9                   746b819f315e        4 days ago          213.4 MB
64
-    postgres                  9.3                 746b819f315e        4 days ago          213.4 MB
65
-    postgres                  9.3.5               746b819f315e        4 days ago          213.4 MB
66
-    postgres                  latest              746b819f315e        4 days ago          213.4 MB
67
-
68
-### Listing images by name and tag
56
+### List the most recently created images
57
+
58
+```bash
59
+$ docker images
60
+
61
+REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
62
+<none>                    <none>              77af4d6b9913        19 hours ago        1.089 GB
63
+committ                   latest              b6fa739cedf5        19 hours ago        1.089 GB
64
+<none>                    <none>              78a85c484f71        19 hours ago        1.089 GB
65
+docker                    latest              30557a29d5ab        20 hours ago        1.089 GB
66
+<none>                    <none>              5ed6274db6ce        24 hours ago        1.089 GB
67
+postgres                  9                   746b819f315e        4 days ago          213.4 MB
68
+postgres                  9.3                 746b819f315e        4 days ago          213.4 MB
69
+postgres                  9.3.5               746b819f315e        4 days ago          213.4 MB
70
+postgres                  latest              746b819f315e        4 days ago          213.4 MB
71
+```
72
+
73
+### List images by name and tag
69 74
 
70 75
 The `docker images` command takes an optional `[REPOSITORY[:TAG]]` argument
71 76
 that restricts the list to images that match the argument. If you specify
... ...
@@ -74,11 +81,14 @@ given repository.
74 74
 
75 75
 For example, to list all images in the "java" repository, run this command :
76 76
 
77
-    $ docker images java
78
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
79
-    java                8                   308e519aac60        6 days ago          824.5 MB
80
-    java                7                   493d82594c15        3 months ago        656.3 MB
81
-    java                latest              2711b1d6f3aa        5 months ago        603.9 MB
77
+```bash
78
+$ docker images java
79
+
80
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
81
+java                8                   308e519aac60        6 days ago          824.5 MB
82
+java                7                   493d82594c15        3 months ago        656.3 MB
83
+java                latest              2711b1d6f3aa        5 months ago        603.9 MB
84
+```
82 85
 
83 86
 The `[REPOSITORY[:TAG]]` value must be an "exact match". This means that, for example,
84 87
 `docker images jav` does not match the image `java`.
... ...
@@ -87,46 +97,57 @@ If both `REPOSITORY` and `TAG` are provided, only images matching that
87 87
 repository and tag are listed.  To find all local images in the "java"
88 88
 repository with tag "8" you can use:
89 89
 
90
-    $ docker images java:8
91
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
92
-    java                8                   308e519aac60        6 days ago          824.5 MB
90
+```bash
91
+$ docker images java:8
92
+
93
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
94
+java                8                   308e519aac60        6 days ago          824.5 MB
95
+```
93 96
 
94 97
 If nothing matches `REPOSITORY[:TAG]`, the list is empty.
95 98
 
96
-    $ docker images java:0
97
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
99
+```bash
100
+$ docker images java:0
98 101
 
99
-## Listing the full length image IDs
102
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
103
+```
100 104
 
101
-    $ docker images --no-trunc
102
-    REPOSITORY                    TAG                 IMAGE ID                                                                  CREATED             SIZE
103
-    <none>                        <none>              sha256:77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182   19 hours ago        1.089 GB
104
-    committest                    latest              sha256:b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f   19 hours ago        1.089 GB
105
-    <none>                        <none>              sha256:78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921   19 hours ago        1.089 GB
106
-    docker                        latest              sha256:30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4   20 hours ago        1.089 GB
107
-    <none>                        <none>              sha256:0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5   20 hours ago        1.089 GB
108
-    <none>                        <none>              sha256:18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b   22 hours ago        1.082 GB
109
-    <none>                        <none>              sha256:f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a   23 hours ago        1.089 GB
110
-    tryout                        latest              sha256:2629d1fa0b81b222fca63371ca16cbf6a0772d07759ff80e8d1369b926940074   23 hours ago        131.5 MB
111
-    <none>                        <none>              sha256:5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df   24 hours ago        1.089 GB
105
+### List the full length image IDs
106
+
107
+```bash
108
+$ docker images --no-trunc
109
+
110
+REPOSITORY                    TAG                 IMAGE ID                                                                  CREATED             SIZE
111
+<none>                        <none>              sha256:77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182   19 hours ago        1.089 GB
112
+committest                    latest              sha256:b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f   19 hours ago        1.089 GB
113
+<none>                        <none>              sha256:78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921   19 hours ago        1.089 GB
114
+docker                        latest              sha256:30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4   20 hours ago        1.089 GB
115
+<none>                        <none>              sha256:0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5   20 hours ago        1.089 GB
116
+<none>                        <none>              sha256:18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b   22 hours ago        1.082 GB
117
+<none>                        <none>              sha256:f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a   23 hours ago        1.089 GB
118
+tryout                        latest              sha256:2629d1fa0b81b222fca63371ca16cbf6a0772d07759ff80e8d1369b926940074   23 hours ago        131.5 MB
119
+<none>                        <none>              sha256:5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df   24 hours ago        1.089 GB
120
+```
112 121
 
113
-## Listing image digests
122
+### List image digests
114 123
 
115 124
 Images that use the v2 or later format have a content-addressable identifier
116 125
 called a `digest`. As long as the input used to generate the image is
117 126
 unchanged, the digest value is predictable. To list image digest values, use
118 127
 the `--digests` flag:
119 128
 
120
-    $ docker images --digests
121
-    REPOSITORY                         TAG                 DIGEST                                                                    IMAGE ID            CREATED             SIZE
122
-    localhost:5000/test/busybox        <none>              sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536        9 weeks ago         2.43 MB
129
+```bash
130
+$ docker images --digests
131
+REPOSITORY                         TAG                 DIGEST                                                                    IMAGE ID            CREATED             SIZE
132
+localhost:5000/test/busybox        <none>              sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536        9 weeks ago         2.43 MB
133
+```
123 134
 
124 135
 When pushing or pulling to a 2.0 registry, the `push` or `pull` command
125 136
 output includes the image digest. You can `pull` using a digest value. You can
126 137
 also reference by digest in `create`, `run`, and `rmi` commands, as well as the
127 138
 `FROM` image reference in a Dockerfile.
128 139
 
129
-## Filtering
140
+### Filtering
130 141
 
131 142
 The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
132 143
 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -138,133 +159,147 @@ The currently supported filters are:
138 138
 * before (`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`) - filter images created before given id or references
139 139
 * since (`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`) - filter images created since given id or references
140 140
 
141
-##### Untagged images (dangling)
141
+#### Show untagged images (dangling)
142 142
 
143
-    $ docker images --filter "dangling=true"
143
+```bash
144
+$ docker images --filter "dangling=true"
144 145
 
145
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
146
-    <none>              <none>              8abc22fbb042        4 weeks ago         0 B
147
-    <none>              <none>              48e5f45168b9        4 weeks ago         2.489 MB
148
-    <none>              <none>              bf747efa0e2f        4 weeks ago         0 B
149
-    <none>              <none>              980fe10e5736        12 weeks ago        101.4 MB
150
-    <none>              <none>              dea752e4e117        12 weeks ago        101.4 MB
151
-    <none>              <none>              511136ea3c5a        8 months ago        0 B
152
-
153
-This will display untagged images, that are the leaves of the images tree (not
146
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
147
+<none>              <none>              8abc22fbb042        4 weeks ago         0 B
148
+<none>              <none>              48e5f45168b9        4 weeks ago         2.489 MB
149
+<none>              <none>              bf747efa0e2f        4 weeks ago         0 B
150
+<none>              <none>              980fe10e5736        12 weeks ago        101.4 MB
151
+<none>              <none>              dea752e4e117        12 weeks ago        101.4 MB
152
+<none>              <none>              511136ea3c5a        8 months ago        0 B
153
+```
154
+
155
+This will display untagged images that are the leaves of the images tree (not
154 156
 intermediary layers). These images occur when a new build of an image takes the
155 157
 `repo:tag` away from the image ID, leaving it as `<none>:<none>` or untagged.
156 158
 A warning will be issued if trying to remove an image when a container is presently
157 159
 using it. By having this flag it allows for batch cleanup.
158 160
 
159
-Ready for use by `docker rmi ...`, like:
161
+You can use this in conjunction with `docker rmi ...`:
160 162
 
161
-    $ docker rmi $(docker images -f "dangling=true" -q)
163
+```bash
164
+$ docker rmi $(docker images -f "dangling=true" -q)
162 165
 
163
-    8abc22fbb042
164
-    48e5f45168b9
165
-    bf747efa0e2f
166
-    980fe10e5736
167
-    dea752e4e117
168
-    511136ea3c5a
166
+8abc22fbb042
167
+48e5f45168b9
168
+bf747efa0e2f
169
+980fe10e5736
170
+dea752e4e117
171
+511136ea3c5a
172
+```
169 173
 
170
-NOTE: Docker will warn you if any containers exist that are using these untagged images.
174
+> **Note**: Docker warns you if any containers exist that are using these
175
+> untagged images.
171 176
 
172 177
 
173
-##### Labeled images
178
+#### Show images with a given label
174 179
 
175 180
 The `label` filter matches images based on the presence of a `label` alone or a `label` and a
176 181
 value.
177 182
 
178 183
 The following filter matches images with the `com.example.version` label regardless of its value.
179 184
 
180
-    $ docker images --filter "label=com.example.version"
185
+```bash
186
+$ docker images --filter "label=com.example.version"
181 187
 
182
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
183
-    match-me-1          latest              eeae25ada2aa        About a minute ago   188.3 MB
184
-    match-me-2          latest              dea752e4e117        About a minute ago   188.3 MB
188
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
189
+match-me-1          latest              eeae25ada2aa        About a minute ago   188.3 MB
190
+match-me-2          latest              dea752e4e117        About a minute ago   188.3 MB
191
+```
185 192
 
186 193
 The following filter matches images with the `com.example.version` label with the `1.0` value.
187 194
 
188
-    $ docker images --filter "label=com.example.version=1.0"
189
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
190
-    match-me            latest              511136ea3c5a        About a minute ago   188.3 MB
195
+```bash
196
+$ docker images --filter "label=com.example.version=1.0"
197
+
198
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
199
+match-me            latest              511136ea3c5a        About a minute ago   188.3 MB
200
+```
191 201
 
192 202
 In this example, with the `0.1` value, it returns an empty set because no matches were found.
193 203
 
194
-    $ docker images --filter "label=com.example.version=0.1"
195
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
204
+```bash
205
+$ docker images --filter "label=com.example.version=0.1"
206
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
207
+```
196 208
 
197
-#### Before
209
+#### Filter images by time
198 210
 
199 211
 The `before` filter shows only images created before the image with
200 212
 given id or reference. For example, having these images:
201 213
 
202
-    $ docker images
203
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
204
-    image1              latest              eeae25ada2aa        4 minutes ago        188.3 MB
205
-    image2              latest              dea752e4e117        9 minutes ago        188.3 MB
206
-    image3              latest              511136ea3c5a        25 minutes ago       188.3 MB
214
+```bash
215
+$ docker images
207 216
 
208
-Filtering with `before` would give:
217
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
218
+image1              latest              eeae25ada2aa        4 minutes ago        188.3 MB
219
+image2              latest              dea752e4e117        9 minutes ago        188.3 MB
220
+image3              latest              511136ea3c5a        25 minutes ago       188.3 MB
221
+```
209 222
 
210
-    $ docker images --filter "before=image1"
211
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
212
-    image2              latest              dea752e4e117        9 minutes ago        188.3 MB
213
-    image3              latest              511136ea3c5a        25 minutes ago       188.3 MB
223
+Filtering with `before` would give:
214 224
 
215
-#### Since
225
+```bash
226
+$ docker images --filter "before=image1"
216 227
 
217
-The `since` filter shows only images created after the image with
218
-given id or reference. For example, having these images:
219
-
220
-    $ docker images
221
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
222
-    image1              latest              eeae25ada2aa        4 minutes ago        188.3 MB
223
-    image2              latest              dea752e4e117        9 minutes ago        188.3 MB
224
-    image3              latest              511136ea3c5a        25 minutes ago       188.3 MB
228
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
229
+image2              latest              dea752e4e117        9 minutes ago        188.3 MB
230
+image3              latest              511136ea3c5a        25 minutes ago       188.3 MB
231
+```
225 232
 
226 233
 Filtering with `since` would give:
227 234
 
228
-    $ docker images --filter "since=image3"
229
-    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
230
-    image1              latest              eeae25ada2aa        4 minutes ago        188.3 MB
231
-    image2              latest              dea752e4e117        9 minutes ago        188.3 MB
235
+```bash
236
+$ docker images --filter "since=image3"
237
+REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
238
+image1              latest              eeae25ada2aa        4 minutes ago        188.3 MB
239
+image2              latest              dea752e4e117        9 minutes ago        188.3 MB
240
+```
232 241
 
233
-#### Reference
242
+#### Filter images by reference
234 243
 
235 244
 The `reference` filter shows only images whose reference matches
236 245
 the specified pattern.
237 246
 
247
+```bash
238 248
     $ docker images
249
+
239 250
     REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
240 251
     busybox             latest              e02e811dd08f        5 weeks ago         1.09 MB
241 252
     busybox             uclibc              e02e811dd08f        5 weeks ago         1.09 MB
242 253
     busybox             musl                733eb3059dce        5 weeks ago         1.21 MB
243 254
     busybox             glibc               21c16b6787c6        5 weeks ago         4.19 MB
255
+```
244 256
 
245 257
 Filtering with `reference` would give:
246 258
 
259
+```bash
247 260
     $ docker images --filter=reference='busy*:*libc'
248 261
     REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
249 262
     busybox             uclibc              e02e811dd08f        5 weeks ago         1.09 MB
250 263
     busybox             glibc               21c16b6787c6        5 weeks ago         4.19 MB
264
+```
251 265
 
252
-## Formatting
266
+### Format the output
253 267
 
254 268
 The formatting option (`--format`) will pretty print container output
255 269
 using a Go template.
256 270
 
257 271
 Valid placeholders for the Go template are listed below:
258 272
 
259
-Placeholder | Description
260
-`.ID` | Image ID
261
-`.Repository` | Image repository
262
-`.Tag` | Image tag
263
-`.Digest` | Image digest
264
-`.CreatedSince` | Elapsed time since the image was created
265
-`.CreatedAt` | Time when the image was created
266
-`.Size` | Image disk size
273
+| Placeholder | Description|
274
+| ---- | ---- |
275
+| `.ID` | Image ID |
276
+| `.Repository` | Image repository |
277
+| `.Tag` | Image tag |
278
+| `.Digest` | Image digest |
279
+| `.CreatedSince` | Elapsed time since the image was created |
280
+| `.CreatedAt` | Time when the image was created |
281
+| `.Size` | Image disk size |
267 282
 
268 283
 When using the `--format` option, the `image` command will either
269 284
 output the data exactly as the template declares or, when using the
... ...
@@ -273,32 +308,38 @@ output the data exactly as the template declares or, when using the
273 273
 The following example uses a template without headers and outputs the
274 274
 `ID` and `Repository` entries separated by a colon for all images:
275 275
 
276
-    {% raw %}
277
-    $ docker images --format "{{.ID}}: {{.Repository}}"
278
-    77af4d6b9913: <none>
279
-    b6fa739cedf5: committ
280
-    78a85c484f71: <none>
281
-    30557a29d5ab: docker
282
-    5ed6274db6ce: <none>
283
-    746b819f315e: postgres
284
-    746b819f315e: postgres
285
-    746b819f315e: postgres
286
-    746b819f315e: postgres
287
-    {% endraw %}
276
+```bash
277
+{% raw %}
278
+$ docker images --format "{{.ID}}: {{.Repository}}"
279
+
280
+77af4d6b9913: <none>
281
+b6fa739cedf5: committ
282
+78a85c484f71: <none>
283
+30557a29d5ab: docker
284
+5ed6274db6ce: <none>
285
+746b819f315e: postgres
286
+746b819f315e: postgres
287
+746b819f315e: postgres
288
+746b819f315e: postgres
289
+{% endraw %}
290
+```
288 291
 
289 292
 To list all images with their repository and tag in a table format you
290 293
 can use:
291 294
 
292
-    {% raw %}
293
-    $ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"
294
-    IMAGE ID            REPOSITORY                TAG
295
-    77af4d6b9913        <none>                    <none>
296
-    b6fa739cedf5        committ                   latest
297
-    78a85c484f71        <none>                    <none>
298
-    30557a29d5ab        docker                    latest
299
-    5ed6274db6ce        <none>                    <none>
300
-    746b819f315e        postgres                  9
301
-    746b819f315e        postgres                  9.3
302
-    746b819f315e        postgres                  9.3.5
303
-    746b819f315e        postgres                  latest
304
-    {% endraw %}
295
+```bash
296
+{% raw %}
297
+$ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"
298
+
299
+IMAGE ID            REPOSITORY                TAG
300
+77af4d6b9913        <none>                    <none>
301
+b6fa739cedf5        committ                   latest
302
+78a85c484f71        <none>                    <none>
303
+30557a29d5ab        docker                    latest
304
+5ed6274db6ce        <none>                    <none>
305
+746b819f315e        postgres                  9
306
+746b819f315e        postgres                  9.3
307
+746b819f315e        postgres                  9.3.5
308
+746b819f315e        postgres                  latest
309
+{% endraw %}
310
+```
... ...
@@ -26,6 +26,8 @@ Options:
26 26
   -m, --message string   Set commit message for imported image
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 You can specify a `URL` or `-` (dash) to take data directly from `STDIN`. The
30 32
 `URL` can point to an archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz)
31 33
 containing a filesystem or to an individual file on the Docker host.  If you
... ...
@@ -41,33 +43,45 @@ Supported `Dockerfile` instructions:
41 41
 
42 42
 ## Examples
43 43
 
44
-**Import from a remote location:**
44
+### Import from a remote location
45 45
 
46 46
 This will create a new untagged image.
47 47
 
48
-    $ docker import http://example.com/exampleimage.tgz
48
+```bash
49
+$ docker import http://example.com/exampleimage.tgz
50
+```
49 51
 
50
-**Import from a local file:**
52
+### Import from a local file
51 53
 
52
-Import to docker via pipe and `STDIN`.
54
+- Import to docker via pipe and `STDIN`.
53 55
 
54
-    $ cat exampleimage.tgz | docker import - exampleimagelocal:new
56
+  ```bash
57
+  $ cat exampleimage.tgz | docker import - exampleimagelocal:new
58
+  ```
55 59
 
56
-Import with a commit message.
60
+- Import with a commit message.
57 61
 
58
-    $ cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new
62
+  ```bash
63
+  $ cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new
64
+  ```
59 65
 
60
-Import to docker from a local archive.
66
+- Import to docker from a local archive.
61 67
 
68
+  ```bash
62 69
     $ docker import /path/to/exampleimage.tgz
70
+  ```
63 71
 
64
-**Import from a local directory:**
72
+### Import from a local directory
65 73
 
66
-    $ sudo tar -c . | docker import - exampleimagedir
74
+```bash
75
+$ sudo tar -c . | docker import - exampleimagedir
76
+```
67 77
 
68
-**Import from a local directory with new configurations:**
78
+### Import from a local directory with new configurations
69 79
 
70
-    $ sudo tar -c . | docker import --change "ENV DEBUG true" - exampleimagedir
80
+```bash
81
+$ sudo tar -c . | docker import --change "ENV DEBUG true" - exampleimagedir
82
+```
71 83
 
72 84
 Note the `sudo` in this example – you must preserve
73 85
 the ownership of the files (especially root ownership) during the
... ...
@@ -25,6 +25,8 @@ You start the Docker daemon with the command line. How you start the daemon
25 25
 affects your Docker containers. For that reason you should also make sure to
26 26
 read the [`dockerd`](dockerd.md) reference page.
27 27
 
28
+## Commands by object
29
+
28 30
 ### Docker management commands
29 31
 
30 32
 | Command | Description                                                        |
... ...
@@ -123,7 +125,7 @@ read the [`dockerd`](dockerd.md) reference page.
123 123
 | [node rm](node_rm.md) | Remove one or more nodes from the swarm                         |
124 124
 | [node update](node_update.md) | Update attributes for a node                 |
125 125
 
126
-### Swarm swarm commands
126
+### Swarm management commands
127 127
 
128 128
 | Command | Description                                                        |
129 129
 |:--------|:-------------------------------------------------------------------|
... ...
@@ -25,6 +25,8 @@ Options:
25 25
       --help            Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 This command displays system wide information regarding the Docker installation.
29 31
 Information displayed includes the kernel version, number of containers and images.
30 32
 The number of images shown is the number of unique images. The same image tagged
... ...
@@ -43,182 +45,201 @@ meta data regarding those images are stored. When run for the first time Docker
43 43
 allocates a certain amount of data space and meta data space from the space
44 44
 available on the volume where `/var/lib/docker` is mounted.
45 45
 
46
-# Examples
46
+## Examples
47
+
48
+### Show output
49
+
50
+The example below shows the output for a daemon running on Red Hat Enterprise Linux,
51
+using the `devicemapper` storage driver. As can be seen in the output, additional
52
+information about the `devicemapper` storage driver is shown:
53
+
54
+```bash
55
+$ docker info
56
+
57
+Containers: 14
58
+ Running: 3
59
+ Paused: 1
60
+ Stopped: 10
61
+Images: 52
62
+Server Version: 1.10.3
63
+Storage Driver: devicemapper
64
+ Pool Name: docker-202:2-25583803-pool
65
+ Pool Blocksize: 65.54 kB
66
+ Base Device Size: 10.74 GB
67
+ Backing Filesystem: xfs
68
+ Data file: /dev/loop0
69
+ Metadata file: /dev/loop1
70
+ Data Space Used: 1.68 GB
71
+ Data Space Total: 107.4 GB
72
+ Data Space Available: 7.548 GB
73
+ Metadata Space Used: 2.322 MB
74
+ Metadata Space Total: 2.147 GB
75
+ Metadata Space Available: 2.145 GB
76
+ Udev Sync Supported: true
77
+ Deferred Removal Enabled: false
78
+ Deferred Deletion Enabled: false
79
+ Deferred Deleted Device Count: 0
80
+ Data loop file: /var/lib/docker/devicemapper/devicemapper/data
81
+ Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
82
+ Library Version: 1.02.107-RHEL7 (2015-12-01)
83
+Execution Driver: native-0.2
84
+Logging Driver: json-file
85
+Plugins:
86
+ Volume: local
87
+ Network: null host bridge
88
+Kernel Version: 3.10.0-327.el7.x86_64
89
+Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
90
+OSType: linux
91
+Architecture: x86_64
92
+CPUs: 1
93
+Total Memory: 991.7 MiB
94
+Name: ip-172-30-0-91.ec2.internal
95
+ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S
96
+Docker Root Dir: /var/lib/docker
97
+Debug mode (client): false
98
+Debug mode (server): false
99
+Username: gordontheturtle
100
+Registry: https://index.docker.io/v1/
101
+Insecure registries:
102
+ myinsecurehost:5000
103
+ 127.0.0.0/8
104
+```
47 105
 
48
-## Display Docker system information
106
+### Show debugging output
49 107
 
50 108
 Here is a sample output for a daemon running on Ubuntu, using the overlay2
51 109
 storage driver and a node that is part of a 2-node swarm:
52 110
 
53
-    $ docker -D info
54
-    Containers: 14
55
-     Running: 3
56
-     Paused: 1
57
-     Stopped: 10
58
-    Images: 52
59
-    Server Version: 1.13.0
60
-    Storage Driver: overlay2
61
-     Backing Filesystem: extfs
62
-     Supports d_type: true
63
-     Native Overlay Diff: false
64
-    Logging Driver: json-file
65
-    Cgroup Driver: cgroupfs
66
-    Plugins:
67
-     Volume: local
68
-     Network: bridge host macvlan null overlay
69
-    Swarm: active
70
-     NodeID: rdjq45w1op418waxlairloqbm
71
-     Is Manager: true
72
-     ClusterID: te8kdyw33n36fqiz74bfjeixd
73
-     Managers: 1
74
-     Nodes: 2
75
-     Orchestration:
76
-      Task History Retention Limit: 5
77
-     Raft:
78
-      Snapshot Interval: 10000
79
-      Number of Old Snapshots to Retain: 0
80
-      Heartbeat Tick: 1
81
-      Election Tick: 3
82
-     Dispatcher:
83
-      Heartbeat Period: 5 seconds
84
-     CA Configuration:
85
-      Expiry Duration: 3 months
86
-     Node Address: 172.16.66.128 172.16.66.129
87
-     Manager Addresses:
88
-      172.16.66.128:2477
89
-    Runtimes: runc
90
-    Default Runtime: runc
91
-    Init Binary: docker-init
92
-    containerd version: 8517738ba4b82aff5662c97ca4627e7e4d03b531
93
-    runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2
94
-    init version: N/A (expected: v0.13.0)
95
-    Security Options:
96
-     apparmor
97
-     seccomp
98
-      Profile: default
99
-    Kernel Version: 4.4.0-31-generic
100
-    Operating System: Ubuntu 16.04.1 LTS
101
-    OSType: linux
102
-    Architecture: x86_64
103
-    CPUs: 2
104
-    Total Memory: 1.937 GiB
105
-    Name: ubuntu
106
-    ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326
107
-    Docker Root Dir: /var/lib/docker
108
-    Debug Mode (client): true
109
-    Debug Mode (server): true
110
-     File Descriptors: 30
111
-     Goroutines: 123
112
-     System Time: 2016-11-12T17:24:37.955404361-08:00
113
-     EventsListeners: 0
114
-    Http Proxy: http://test:test@proxy.example.com:8080
115
-    Https Proxy: https://test:test@proxy.example.com:8080
116
-    No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com
117
-    Registry: https://index.docker.io/v1/
118
-    WARNING: No swap limit support
119
-    Labels:
120
-     storage=ssd
121
-     staging=true
122
-    Experimental: false
123
-    Insecure Registries:
124
-     127.0.0.0/8
125
-    Registry Mirrors:
126
-      http://192.168.1.2/
127
-      http://registry-mirror.example.com:5000/
128
-    Live Restore Enabled: false
129
-
130
-The global `-D` option tells all `docker` commands to output debug information.
111
+```bash
112
+$ docker -D info
113
+
114
+Containers: 14
115
+ Running: 3
116
+ Paused: 1
117
+ Stopped: 10
118
+Images: 52
119
+Server Version: 1.13.0
120
+Storage Driver: overlay2
121
+ Backing Filesystem: extfs
122
+ Supports d_type: true
123
+ Native Overlay Diff: false
124
+Logging Driver: json-file
125
+Cgroup Driver: cgroupfs
126
+Plugins:
127
+ Volume: local
128
+ Network: bridge host macvlan null overlay
129
+Swarm: active
130
+ NodeID: rdjq45w1op418waxlairloqbm
131
+ Is Manager: true
132
+ ClusterID: te8kdyw33n36fqiz74bfjeixd
133
+ Managers: 1
134
+ Nodes: 2
135
+ Orchestration:
136
+  Task History Retention Limit: 5
137
+ Raft:
138
+  Snapshot Interval: 10000
139
+  Number of Old Snapshots to Retain: 0
140
+  Heartbeat Tick: 1
141
+  Election Tick: 3
142
+ Dispatcher:
143
+  Heartbeat Period: 5 seconds
144
+ CA Configuration:
145
+  Expiry Duration: 3 months
146
+ Node Address: 172.16.66.128 172.16.66.129
147
+ Manager Addresses:
148
+  172.16.66.128:2477
149
+Runtimes: runc
150
+Default Runtime: runc
151
+Init Binary: docker-init
152
+containerd version: 8517738ba4b82aff5662c97ca4627e7e4d03b531
153
+runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2
154
+init version: N/A (expected: v0.13.0)
155
+Security Options:
156
+ apparmor
157
+ seccomp
158
+  Profile: default
159
+Kernel Version: 4.4.0-31-generic
160
+Operating System: Ubuntu 16.04.1 LTS
161
+OSType: linux
162
+Architecture: x86_64
163
+CPUs: 2
164
+Total Memory: 1.937 GiB
165
+Name: ubuntu
166
+ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326
167
+Docker Root Dir: /var/lib/docker
168
+Debug Mode (client): true
169
+Debug Mode (server): true
170
+ File Descriptors: 30
171
+ Goroutines: 123
172
+ System Time: 2016-11-12T17:24:37.955404361-08:00
173
+ EventsListeners: 0
174
+Http Proxy: http://test:test@proxy.example.com:8080
175
+Https Proxy: https://test:test@proxy.example.com:8080
176
+No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com
177
+Registry: https://index.docker.io/v1/
178
+WARNING: No swap limit support
179
+Labels:
180
+ storage=ssd
181
+ staging=true
182
+Experimental: false
183
+Insecure Registries:
184
+ 127.0.0.0/8
185
+Registry Mirrors:
186
+  http://192.168.1.2/
187
+  http://registry-mirror.example.com:5000/
188
+Live Restore Enabled: false
189
+```
190
+
191
+The global `-D` option causes all `docker` commands to output debug information.
131 192
 
132
-The example below shows the output for a daemon running on Red Hat Enterprise Linux,
133
-using the devicemapper storage driver. As can be seen in the output, additional
134
-information about the devicemapper storage driver is shown:
135
-
136
-    $ docker info
137
-    Containers: 14
138
-     Running: 3
139
-     Paused: 1
140
-     Stopped: 10
141
-    Images: 52
142
-    Server Version: 1.10.3
143
-    Storage Driver: devicemapper
144
-     Pool Name: docker-202:2-25583803-pool
145
-     Pool Blocksize: 65.54 kB
146
-     Base Device Size: 10.74 GB
147
-     Backing Filesystem: xfs
148
-     Data file: /dev/loop0
149
-     Metadata file: /dev/loop1
150
-     Data Space Used: 1.68 GB
151
-     Data Space Total: 107.4 GB
152
-     Data Space Available: 7.548 GB
153
-     Metadata Space Used: 2.322 MB
154
-     Metadata Space Total: 2.147 GB
155
-     Metadata Space Available: 2.145 GB
156
-     Udev Sync Supported: true
157
-     Deferred Removal Enabled: false
158
-     Deferred Deletion Enabled: false
159
-     Deferred Deleted Device Count: 0
160
-     Data loop file: /var/lib/docker/devicemapper/devicemapper/data
161
-     Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
162
-     Library Version: 1.02.107-RHEL7 (2015-12-01)
163
-    Execution Driver: native-0.2
164
-    Logging Driver: json-file
165
-    Plugins:
166
-     Volume: local
167
-     Network: null host bridge
168
-    Kernel Version: 3.10.0-327.el7.x86_64
169
-    Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
170
-    OSType: linux
171
-    Architecture: x86_64
172
-    CPUs: 1
173
-    Total Memory: 991.7 MiB
174
-    Name: ip-172-30-0-91.ec2.internal
175
-    ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S
176
-    Docker Root Dir: /var/lib/docker
177
-    Debug mode (client): false
178
-    Debug mode (server): false
179
-    Username: gordontheturtle
180
-    Registry: https://index.docker.io/v1/
181
-    Insecure registries:
182
-     myinsecurehost:5000
183
-     127.0.0.0/8
193
+### Format the output
184 194
 
185 195
 You can also specify the output format:
186 196
 
187
-    $ docker info --format '{{json .}}'
188
-	{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
197
+```bash
198
+{% raw %}
199
+$ docker info --format '{{json .}}'
200
+
201
+{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
202
+```
203
+
204
+### Run `docker info` on Windows
189 205
 
190 206
 Here is a sample output for a daemon running on Windows Server 2016:
191 207
 
192
-    E:\docker>docker info
193
-    Containers: 1
194
-     Running: 0
195
-     Paused: 0
196
-     Stopped: 1
197
-    Images: 17
198
-    Server Version: 1.13.0
199
-    Storage Driver: windowsfilter
200
-     Windows:
201
-    Logging Driver: json-file
202
-    Plugins:
203
-     Volume: local
204
-     Network: nat null overlay
205
-    Swarm: inactive
206
-    Default Isolation: process
207
-    Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)
208
-    Operating System: Windows Server 2016 Datacenter
209
-    OSType: windows
210
-    Architecture: x86_64
211
-    CPUs: 8
212
-    Total Memory: 3.999 GiB
213
-    Name: WIN-V0V70C0LU5P
214
-    ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62
215
-    Docker Root Dir: C:\control
216
-    Debug Mode (client): false
217
-    Debug Mode (server): false
218
-    Registry: https://index.docker.io/v1/
219
-    Insecure Registries:
220
-     127.0.0.0/8
221
-    Registry Mirrors:
222
-      http://192.168.1.2/
223
-      http://registry-mirror.example.com:5000/
224
-    Live Restore Enabled: false
208
+```none
209
+E:\docker>docker info
210
+
211
+Containers: 1
212
+ Running: 0
213
+ Paused: 0
214
+ Stopped: 1
215
+Images: 17
216
+Server Version: 1.13.0
217
+Storage Driver: windowsfilter
218
+ Windows:
219
+Logging Driver: json-file
220
+Plugins:
221
+ Volume: local
222
+ Network: nat null overlay
223
+Swarm: inactive
224
+Default Isolation: process
225
+Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)
226
+Operating System: Windows Server 2016 Datacenter
227
+OSType: windows
228
+Architecture: x86_64
229
+CPUs: 8
230
+Total Memory: 3.999 GiB
231
+Name: WIN-V0V70C0LU5P
232
+ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62
233
+Docker Root Dir: C:\control
234
+Debug Mode (client): false
235
+Debug Mode (server): false
236
+Registry: https://index.docker.io/v1/
237
+Insecure Registries:
238
+ 127.0.0.0/8
239
+Registry Mirrors:
240
+  http://192.168.1.2/
241
+  http://registry-mirror.example.com:5000/
242
+Live Restore Enabled: false
243
+```
... ...
@@ -28,7 +28,9 @@ Options:
28 28
       --type         Return JSON for specified type
29 29
 ```
30 30
 
31
-By default, this will render all results in a JSON array. If the container and
31
+## Description
32
+
33
+By default, `docker inspect` will render all results in a JSON array. If the container and
32 34
 image have the same name, this will return container JSON for unspecified type.
33 35
 If a format is specified, the given template will be executed for each result.
34 36
 
... ...
@@ -37,46 +39,53 @@ describes all the details of the format.
37 37
 
38 38
 ## Examples
39 39
 
40
-**Get an instance's IP address:**
40
+### Get an instance's IP address
41 41
 
42 42
 For the most part, you can pick out any field from the JSON in a fairly
43 43
 straightforward manner.
44 44
 
45
-    {% raw %}
46
-    $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID
47
-    {% endraw %}
48
-
49
-**Get an instance's MAC address:**
45
+```bash
46
+{% raw %}
47
+$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID
48
+{% endraw %}
49
+```
50 50
 
51
-For the most part, you can pick out any field from the JSON in a fairly
52
-straightforward manner.
51
+### Get an instance's MAC address
53 52
 
54
-    {% raw %}
55
-    $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID
56
-    {% endraw %}
53
+```bash
54
+{% raw %}
55
+$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID
56
+{% endraw %}
57
+```
57 58
 
58
-**Get an instance's log path:**
59
+### Get an instance's log path
59 60
 
60
-    {% raw %}
61
-    $ docker inspect --format='{{.LogPath}}' $INSTANCE_ID
62
-    {% endraw %}
61
+```bash
62
+{% raw %}
63
+$ docker inspect --format='{{.LogPath}}' $INSTANCE_ID
64
+{% endraw %}
65
+```
63 66
 
64
-**Get a Task's image name:**
67
+### Get an instance's image name
65 68
 
66
-    {% raw %}
67
-    $ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID
68
-    {% endraw %}
69
+```bash
70
+{% raw %}
71
+$ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID
72
+{% endraw %}
73
+```
69 74
 
70
-**List all port bindings:**
75
+### List all port bindings
71 76
 
72
-One can loop over arrays and maps in the results to produce simple text
77
+You can loop over arrays and maps in the results to produce simple text
73 78
 output:
74 79
 
75
-    {% raw %}
76
-    $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
77
-    {% endraw %}
80
+```bash
81
+{% raw %}
82
+$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
83
+{% endraw %}
84
+```
78 85
 
79
-**Find a specific port mapping:**
86
+### Find a specific port mapping
80 87
 
81 88
 The `.Field` syntax doesn't work when the field name begins with a
82 89
 number, but the template language's `index` function does. The
... ...
@@ -86,17 +95,21 @@ numeric public port, you use `index` to find the specific port map, and
86 86
 then `index` 0 contains the first object inside of that. Then we ask for
87 87
 the `HostPort` field to get the public address.
88 88
 
89
-    {% raw %}
90
-    $ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
91
-    {% endraw %}
89
+```bash
90
+{% raw %}
91
+$ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
92
+{% endraw %}
93
+```
92 94
 
93
-**Get a subsection in JSON format:**
95
+### Get a subsection in JSON format
94 96
 
95 97
 If you request a field which is itself a structure containing other
96 98
 fields, by default you get a Go-style dump of the inner values.
97 99
 Docker adds a template function, `json`, which can be applied to get
98 100
 results in JSON format.
99 101
 
100
-    {% raw %}
101
-    $ docker inspect --format='{{json .Config}}' $INSTANCE_ID
102
-    {% endraw %}
102
+```bash
103
+{% raw %}
104
+$ docker inspect --format='{{json .Config}}' $INSTANCE_ID
105
+{% endraw %}
106
+```
... ...
@@ -25,10 +25,11 @@ Options:
25 25
   -s, --signal string   Signal to send to the container (default "KILL")
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 The main process inside the container will be sent `SIGKILL`, or any
29 31
 signal specified with option `--signal`.
30 32
 
31
-> **Note:**
32
-> `ENTRYPOINT` and `CMD` in the *shell* form run as a subcommand of `/bin/sh -c`,
33
-> which does not pass signals. This means that the executable is not the container’s PID 1
34
-> and does not receive Unix signals.
33
+> **Note**: `ENTRYPOINT` and `CMD` in the *shell* form run as a subcommand of
34
+> `/bin/sh -c`, which does not pass signals. This means that the executable is
35
+> not the container’s PID 1 and does not receive Unix signals.
... ...
@@ -26,28 +26,37 @@ Options:
26 26
                        The tarball may be compressed with gzip, bzip, or xz
27 27
   -q, --quiet          Suppress the load output but still outputs the imported images
28 28
 ```
29
+## Descriptino
29 30
 
30
-Loads a tarred repository from a file or the standard input stream.
31
-Restores both images and tags.
32
-
33
-    $ docker images
34
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
35
-    $ docker load < busybox.tar.gz
36
-    # […]
37
-    Loaded image: busybox:latest
38
-    $ docker images
39
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
40
-    busybox             latest              769b9341d937        7 weeks ago         2.489 MB
41
-    $ docker load --input fedora.tar
42
-    # […]
43
-    Loaded image: fedora:rawhide
44
-    # […]
45
-    Loaded image: fedora:20
46
-    # […]
47
-    $ docker images
48
-    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
49
-    busybox             latest              769b9341d937        7 weeks ago         2.489 MB
50
-    fedora              rawhide             0d20aec6529d        7 weeks ago         387 MB
51
-    fedora              20                  58394af37342        7 weeks ago         385.5 MB
52
-    fedora              heisenbug           58394af37342        7 weeks ago         385.5 MB
53
-    fedora              latest              58394af37342        7 weeks ago         385.5 MB
31
+`docker load` loads a tarred repository from a file or the standard input stream.
32
+It restores both images and tags.
33
+
34
+## Examples
35
+
36
+```bash
37
+$ docker images
38
+
39
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
40
+
41
+$ docker load < busybox.tar.gz
42
+
43
+Loaded image: busybox:latest
44
+$ docker images
45
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
46
+busybox             latest              769b9341d937        7 weeks ago         2.489 MB
47
+
48
+$ docker load --input fedora.tar
49
+
50
+Loaded image: fedora:rawhide
51
+
52
+Loaded image: fedora:20
53
+
54
+$ docker images
55
+
56
+REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
57
+busybox             latest              769b9341d937        7 weeks ago         2.489 MB
58
+fedora              rawhide             0d20aec6529d        7 weeks ago         387 MB
59
+fedora              20                  58394af37342        7 weeks ago         385.5 MB
60
+fedora              heisenbug           58394af37342        7 weeks ago         385.5 MB
61
+fedora              latest              58394af37342        7 weeks ago         385.5 MB
62
+```
... ...
@@ -27,12 +27,20 @@ Options:
27 27
   -u, --username string   Username
28 28
 ```
29 29
 
30
+## Description
31
+
32
+Login to a registry.
33
+
34
+### Login to a self-hosted registry
35
+
30 36
 If you want to login to a self-hosted registry you can specify this by
31 37
 adding the server name.
32 38
 
33
-    example:
34
-    $ docker login localhost:8080
39
+```bash
40
+$ docker login localhost:8080
41
+```
35 42
 
43
+### Privileged user requirement
36 44
 
37 45
 `docker login` requires user to use `sudo` or be `root`, except when:
38 46
 
... ...
@@ -43,7 +51,7 @@ You can log into any public or private repository for which you have
43 43
 credentials.  When you log in, the command stores encoded credentials in
44 44
 `$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on Windows.
45 45
 
46
-## Credentials store
46
+### Credentials store
47 47
 
48 48
 The Docker Engine can keep user credentials in an external credentials store,
49 49
 such as the native keychain of the operating system. Using an external store
... ...
@@ -60,8 +68,6 @@ you can download them from:
60 60
 - Apple macOS keychain: https://github.com/docker/docker-credential-helpers/releases
61 61
 - Microsoft Windows Credential Manager: https://github.com/docker/docker-credential-helpers/releases
62 62
 
63
-### Usage
64
-
65 63
 You need to specify the credentials store in `$HOME/.docker/config.json`
66 64
 to tell the docker engine to use it:
67 65
 
... ...
@@ -74,7 +80,7 @@ to tell the docker engine to use it:
74 74
 If you are currently logged in, run `docker logout` to remove
75 75
 the credentials from the file and run `docker login` again.
76 76
 
77
-### Protocol
77
+### Credential helper protocol
78 78
 
79 79
 Credential helpers can be any program or script that follows a very simple protocol.
80 80
 This protocol is heavily inspired by Git, but it differs in the information shared.
... ...
@@ -120,3 +126,31 @@ an example of that payload: `https://index.docker.io/v1`.
120 120
 
121 121
 The `erase` command can write error messages to `STDOUT` that the docker engine
122 122
 will show if there was an issue.
123
+
124
+### Credential helpers
125
+
126
+Credential helpers are similar to the credential store above, but act as the
127
+designated programs to handle credentials for *specific registries*. The default
128
+credential store (`credsStore` or the config file itself) will not be used for
129
+operations concerning credentials of the specified registries.
130
+
131
+### Logging out
132
+
133
+If you are currently logged in, run `docker logout` to remove
134
+the credentials from the default store.
135
+
136
+Credential helpers are specified in a similar way to `credsStore`, but
137
+allow for multiple helpers to be configured at a time. Keys specify the
138
+registry domain, and values specify the suffix of the program to use
139
+(i.e. everything after `docker-credential-`).
140
+For example:
141
+
142
+```json
143
+{
144
+  "credHelpers": {
145
+    "registry.example.com": "registryhelper",
146
+    "awesomereg.example.org": "hip-star",
147
+    "unicorn.example.io": "vcbait"
148
+  }
149
+}
150
+```
... ...
@@ -25,6 +25,8 @@ Options:
25 25
       --help   Print usage
26 26
 ```
27 27
 
28
-For example:
28
+## Examples
29 29
 
30
-    $ docker logout localhost:8080
30
+```bash
31
+$ docker logout localhost:8080
32
+```
... ...
@@ -24,11 +24,13 @@ Options:
24 24
       --details        Show extra details provided to logs
25 25
   -f, --follow         Follow log output
26 26
       --help           Print usage
27
-      --since string   Show logs since timestamp
27
+      --since string   Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
28 28
       --tail string    Number of lines to show from the end of the logs (default "all")
29 29
   -t, --timestamps     Show timestamps
30 30
 ```
31 31
 
32
+## Description
33
+
32 34
 The `docker logs` command batch-retrieves logs present at the time of execution.
33 35
 
34 36
 > **Note**: this command is only functional for containers that are started with
35 37
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-title: "Command line reference"
2
-description: "Docker's CLI command description and usage"
3
-keywords: "Docker, Docker documentation, CLI, command line"
4
-identifier:  "smn_cli"
5
-
6
-<!-- This file is maintained within the docker/docker Github
7
-     repository at https://github.com/docker/docker/. Make all
8
-     pull requests against that repo. If you see this file in
9
-     another repository, consider it read-only there, as it will
10
-     periodically be overwritten by the definitive file. Pull
11
-     requests which include edits to this file in other repositories
12
-     will be rejected.
13
-
14
-# The Docker commands
15
-
16
-This section contains reference information on using Docker's command line
17
-client. Each command has a reference page along with samples. If you are
18
-unfamiliar with the command line, you should start by reading about how to
19
-[Use the Docker command line](cli.md).
20
-
21
-You start the Docker daemon with the command line. How you start the daemon
22
-affects your Docker containers. For that reason you should also make sure to
23
-read the [`dockerd`](dockerd.md) reference page.
24
-
25
-For a list of Docker commands see [Command line reference guide](index.md).
... ...
@@ -29,38 +29,55 @@ Options:
29 29
       --link-local-ip value   Add a link-local address for the container (default [])
30 30
 ```
31 31
 
32
+## Description
33
+
32 34
 Connects a container to a network. You can connect a container by name
33 35
 or by ID. Once connected, the container can communicate with other containers in
34 36
 the same network.
35 37
 
38
+## Examples
39
+
40
+### Connect a running container to a network
41
+
36 42
 ```bash
37 43
 $ docker network connect multi-host-network container1
38 44
 ```
39 45
 
46
+### Connect a container to a network when it starts
47
+
40 48
 You can also use the `docker run --network=<network-name>` option to start a container and immediately connect it to a network.
41 49
 
42 50
 ```bash
43 51
 $ docker run -itd --network=multi-host-network busybox
44 52
 ```
45 53
 
54
+### Specify the IP address a container will use on a given network
55
+
46 56
 You can specify the IP address you want to be assigned to the container's interface.
47 57
 
48 58
 ```bash
49 59
 $ docker network connect --ip 10.10.36.122 multi-host-network container2
50 60
 ```
51 61
 
62
+### Use the legacy `--link` option
63
+
52 64
 You can use `--link` option to link another container with a preferred alias
53 65
 
54 66
 ```bash
55 67
 $ docker network connect --link container1:c1 multi-host-network container2
56 68
 ```
57 69
 
70
+### Create a network alias for a container
71
+
58 72
 `--alias` option can be used to resolve the container by another name in the network
59 73
 being connected to.
60 74
 
61 75
 ```bash
62 76
 $ docker network connect --alias db --alias mysql multi-host-network container2
63 77
 ```
78
+
79
+### Network implications of stopping, pausing, or restarting containers
80
+
64 81
 You can pause, restart, and stop containers that are connected to a network.
65 82
 A container connects to its configured networks when it runs.
66 83
 
... ...
@@ -88,7 +105,7 @@ network but launched from different Engines can also communicate in this way.
88 88
 
89 89
 You can connect a container to one or more networks. The networks need not be the same type. For example, you can connect a single container bridge and overlay networks.
90 90
 
91
-## Related information
91
+## Related commands
92 92
 
93 93
 * [network inspect](network_inspect.md)
94 94
 * [network create](network_create.md)
... ...
@@ -38,6 +38,8 @@ Options:
38 38
                              network segment (default [])
39 39
 ```
40 40
 
41
+## Description
42
+
41 43
 Creates a new network. The `DRIVER` accepts `bridge` or `overlay` which are the
42 44
 built-in network drivers. If you have installed a third party or your own custom
43 45
 network driver you can specify that `DRIVER` here also. If you don't specify the
... ...
@@ -86,7 +88,9 @@ Network names must be unique. The Docker daemon attempts to identify naming
86 86
 conflicts but this is not guaranteed. It is the user's responsibility to avoid
87 87
 name conflicts.
88 88
 
89
-## Connect containers
89
+## Examples
90
+
91
+### Connect containers
90 92
 
91 93
 When you start a container, use the `--network` flag to connect it to a network.
92 94
 This example adds the `busybox` container to the `mynet` network:
... ...
@@ -107,7 +111,7 @@ Engines can also communicate in this way.
107 107
 You can disconnect a container from a network using the `docker network
108 108
 disconnect` command.
109 109
 
110
-## Specifying advanced options
110
+### Specify advanced options
111 111
 
112 112
 When you create a network, Engine creates a non-overlapping subnetwork for the
113 113
 network by default. This subnetwork is not a subdivision of an existing
... ...
@@ -150,7 +154,7 @@ $ docker network create -d overlay \
150 150
 Be sure that your subnetworks do not overlap. If they do, the network create
151 151
 fails and Engine returns an error.
152 152
 
153
-# Bridge driver options
153
+### Bridge driver options
154 154
 
155 155
 When creating a custom network, the default network driver (i.e. `bridge`) has
156 156
 additional options that can be passed. The following are those options and the
... ...
@@ -191,7 +195,7 @@ connects a bridge network to it to provide external connectivity. If you want
191 191
 to create an externally isolated `overlay` network, you can specify the
192 192
 `--internal` option.
193 193
 
194
-## Related information
194
+## Related commands
195 195
 
196 196
 * [network inspect](network_inspect.md)
197 197
 * [network connect](network_connect.md)
... ...
@@ -25,14 +25,19 @@ Options:
25 25
       --help    Print usage
26 26
 ```
27 27
 
28
-Disconnects a container from a network. The container must be running to disconnect it from the network.
28
+## Description
29
+
30
+Disconnects a container from a network. The container must be running to
31
+disconnect it from the network.
32
+
33
+## Examples
29 34
 
30 35
 ```bash
31 36
   $ docker network disconnect multi-host-network container1
32 37
 ```
33 38
 
34 39
 
35
-## Related information
40
+## Related commands
36 41
 
37 42
 * [network inspect](network_inspect.md)
38 43
 * [network connect](network_connect.md)
... ...
@@ -25,7 +25,16 @@ Options:
25 25
       --help            Print usage
26 26
 ```
27 27
 
28
-Returns information about one or more networks. By default, this command renders all results in a JSON object. For example, if you connect two containers to the default `bridge` network:
28
+## Description
29
+
30
+Returns information about one or more networks. By default, this command renders
31
+all results in a JSON object.
32
+
33
+## Examples
34
+
35
+## Inspect the `bridge` network
36
+
37
+Connect two containers to the default `bridge` network:
29 38
 
30 39
 ```bash
31 40
 $ sudo docker run -itd --name=container1 busybox
... ...
@@ -47,8 +56,9 @@ template for each result. Go's
47 47
 [text/template](http://golang.org/pkg/text/template/) package describes all the
48 48
 details of the format.
49 49
 
50
-```bash
50
+```none
51 51
 $ sudo docker network inspect bridge
52
+
52 53
 [
53 54
     {
54 55
         "Name": "bridge",
... ...
@@ -95,12 +105,19 @@ $ sudo docker network inspect bridge
95 95
 ]
96 96
 ```
97 97
 
98
-Returns the information about the user-defined network:
98
+### Inspect a user-defined network
99
+
100
+Create and inspect a user-defined network:
99 101
 
100 102
 ```bash
101 103
 $ docker network create simple-network
104
+
102 105
 69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a
106
+```
107
+
108
+```none
103 109
 $ docker network inspect simple-network
110
+
104 111
 [
105 112
     {
106 113
         "Name": "simple-network",
... ...
@@ -124,12 +141,15 @@ $ docker network inspect simple-network
124 124
 ]
125 125
 ```
126 126
 
127
-For swarm mode overlay networks `network inspect` also shows the IP address and node name 
128
-of the peers. Peers are the nodes in the swarm cluster which have at least one task attached 
127
+### Inspect the `ingress` network
128
+
129
+For swarm mode overlay networks `network inspect` also shows the IP address and node name
130
+of the peers. Peers are the nodes in the swarm cluster which have at least one task attached
129 131
 to the network. Node name is of the format `<hostname>-<unique ID>`.
130 132
 
131
-```bash
133
+```none
132 134
 $ docker network inspect ingress
135
+
133 136
 [
134 137
     {
135 138
         "Name": "ingress",
... ...
@@ -181,7 +201,7 @@ $ docker network inspect ingress
181 181
 ]
182 182
 ```
183 183
 
184
-## Related information
184
+## Related commands
185 185
 
186 186
 * [network disconnect ](network_disconnect.md)
187 187
 * [network connect](network_connect.md)
... ...
@@ -31,8 +31,14 @@ Options:
31 31
   -q, --quiet           Only display network IDs
32 32
 ```
33 33
 
34
+## Description
35
+
34 36
 Lists all the networks the Engine `daemon` knows about. This includes the
35
-networks that span across multiple hosts in a cluster, for example:
37
+networks that span across multiple hosts in a cluster.
38
+
39
+## Examples
40
+
41
+### List all networks
36 42
 
37 43
 ```bash
38 44
 $ sudo docker network ls
... ...
@@ -55,7 +61,7 @@ c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47   host
55 55
 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161   dev                 bridge           local
56 56
 ```
57 57
 
58
-## Filtering
58
+### Filtering
59 59
 
60 60
 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
61 61
 is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
... ...
@@ -175,7 +181,7 @@ $ docker network rm `docker network ls --filter type=custom -q`
175 175
 A warning will be issued when trying to remove a network that has containers
176 176
 attached.
177 177
 
178
-## Formatting
178
+### Formatting
179 179
 
180 180
 The formatting options (`--format`) pretty-prints networks output
181 181
 using a Go template.
... ...
@@ -207,7 +213,7 @@ d1584f8dc718: host
207 207
 391df270dc66: null
208 208
 ```
209 209
 
210
-## Related information
210
+## Related commands
211 211
 
212 212
 * [network disconnect ](network_disconnect.md)
213 213
 * [network connect](network_connect.md)
... ...
@@ -16,12 +16,16 @@ Options:
16 16
       --help    Print usage
17 17
 ```
18 18
 
19
-Remove all unused networks. Unused networks are those which are not referenced by any containers.
19
+## Description
20 20
 
21
-Example output:
21
+Remove all unused networks. Unused networks are those which are not referenced
22
+by any containers.
23
+
24
+## Examples
22 25
 
23 26
 ```bash
24 27
 $ docker network prune
28
+
25 29
 WARNING! This will remove all networks not used by at least one container.
26 30
 Are you sure you want to continue? [y/N] y
27 31
 Deleted Networks:
... ...
@@ -29,7 +33,55 @@ n1
29 29
 n2
30 30
 ```
31 31
 
32
-## Related information
32
+### Filtering
33
+
34
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
35
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
36
+
37
+The currently supported filters are:
38
+
39
+* until (`<timestamp>`) - only remove networks created before given timestamp
40
+
41
+The `until` filter can be Unix timestamps, date formatted
42
+timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
43
+relative to the daemon machine’s time. Supported formats for date
44
+formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
45
+`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
46
+timezone on the daemon will be used if you do not provide either a `Z` or a
47
+`+-00:00` timezone offset at the end of the timestamp.  When providing Unix
48
+timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
49
+that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
50
+seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
51
+fraction of a second no more than nine digits long.
52
+
53
+The following removes networks created more than 5 minutes ago. Note that
54
+system networks such as `bridge`, `host`, and `none` will never be pruned:
55
+
56
+```none
57
+$ docker network ls
58
+
59
+NETWORK ID          NAME                DRIVER              SCOPE
60
+7430df902d7a        bridge              bridge              local
61
+ea92373fd499        foo-1-day-ago       bridge              local
62
+ab53663ed3c7        foo-1-min-ago       bridge              local
63
+97b91972bc3b        host                host                local
64
+f949d337b1f5        none                null                local
65
+
66
+$ docker network prune --force --filter until=5m
67
+
68
+Deleted Networks:
69
+foo-1-day-ago
70
+
71
+$ docker network ls
72
+
73
+NETWORK ID          NAME                DRIVER              SCOPE
74
+7430df902d7a        bridge              bridge              local
75
+ab53663ed3c7        foo-1-min-ago       bridge              local
76
+97b91972bc3b        host                host                local
77
+f949d337b1f5        none                null                local
78
+```
79
+
80
+## Related commands
33 81
 
34 82
 * [network disconnect ](network_disconnect.md)
35 83
 * [network connect](network_connect.md)
... ...
@@ -27,14 +27,23 @@ Options:
27 27
       --help   Print usage
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Removes one or more networks by name or identifier. To remove a network,
31 33
 you must first disconnect any containers connected to it.
34
+
35
+## Examples
36
+
37
+### Remove a network
38
+
32 39
 To remove the network named 'my-network':
33 40
 
34 41
 ```bash
35 42
   $ docker network rm my-network
36 43
 ```
37 44
 
45
+### Remove multiple networks
46
+
38 47
 To delete multiple networks in a single `docker network rm` command, provide
39 48
 multiple network names or ids. The following example deletes a network with id
40 49
 `3695c422697f` and a network named `my-network`:
... ...
@@ -48,7 +57,7 @@ If the deletion of one network fails, the command continues to the next on the
48 48
 list and tries to delete that. The command reports success or failure for each
49 49
 deletion.
50 50
 
51
-## Related information
51
+## Related commands
52 52
 
53 53
 * [network disconnect ](network_disconnect.md)
54 54
 * [network connect](network_connect.md)
... ...
@@ -25,14 +25,19 @@ Options:
25 25
 
26 26
 ```
27 27
 
28
-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.
28
+## Description
29 29
 
30
+Demotes an existing manager so that it is no longer a manager. This command
31
+targets a docker engine that is a manager in the swarm.
32
+
33
+
34
+## Examples
30 35
 
31 36
 ```bash
32 37
 $ docker node demote <node name>
33 38
 ```
34 39
 
35
-## Related information
40
+## Related commands
36 41
 
37 42
 * [node inspect](node_inspect.md)
38 43
 * [node ls](node_ls.md)
... ...
@@ -26,108 +26,120 @@ Options:
26 26
       --pretty          Print the information in a human friendly format.
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 Returns information about a node. By default, this command renders all results
30 32
 in a JSON array. You can specify an alternate format to execute a
31 33
 given template for each result. Go's
32 34
 [text/template](http://golang.org/pkg/text/template/) package describes all the
33 35
 details of the format.
34 36
 
35
-Example output:
37
+## Examples
36 38
 
37
-    $ docker node inspect swarm-manager
38
-    [
39
-    {
40
-        "ID": "e216jshn25ckzbvmwlnh5jr3g",
41
-        "Version": {
42
-            "Index": 10
43
-        },
44
-        "CreatedAt": "2016-06-16T22:52:44.9910662Z",
45
-        "UpdatedAt": "2016-06-16T22:52:45.230878043Z",
46
-        "Spec": {
47
-            "Role": "manager",
48
-            "Availability": "active"
49
-        },
50
-        "Description": {
51
-            "Hostname": "swarm-manager",
52
-            "Platform": {
53
-                "Architecture": "x86_64",
54
-                "OS": "linux"
55
-            },
56
-            "Resources": {
57
-                "NanoCPUs": 1000000000,
58
-                "MemoryBytes": 1039843328
59
-            },
60
-            "Engine": {
61
-                "EngineVersion": "1.12.0",
62
-                "Plugins": [
63
-                    {
64
-                        "Type": "Volume",
65
-                        "Name": "local"
66
-                    },
67
-                    {
68
-                        "Type": "Network",
69
-                        "Name": "overlay"
70
-                    },
71
-                    {
72
-                        "Type": "Network",
73
-                        "Name": "null"
74
-                    },
75
-                    {
76
-                        "Type": "Network",
77
-                        "Name": "host"
78
-                    },
79
-                    {
80
-                        "Type": "Network",
81
-                        "Name": "bridge"
82
-                    },
83
-                    {
84
-                        "Type": "Network",
85
-                        "Name": "overlay"
86
-                    }
87
-                ]
88
-            }
39
+### Inspect a node
40
+
41
+```none
42
+$ docker node inspect swarm-manager
43
+
44
+[
45
+{
46
+    "ID": "e216jshn25ckzbvmwlnh5jr3g",
47
+    "Version": {
48
+        "Index": 10
49
+    },
50
+    "CreatedAt": "2016-06-16T22:52:44.9910662Z",
51
+    "UpdatedAt": "2016-06-16T22:52:45.230878043Z",
52
+    "Spec": {
53
+        "Role": "manager",
54
+        "Availability": "active"
55
+    },
56
+    "Description": {
57
+        "Hostname": "swarm-manager",
58
+        "Platform": {
59
+            "Architecture": "x86_64",
60
+            "OS": "linux"
89 61
         },
90
-        "Status": {
91
-            "State": "ready",
92
-            "Addr": "168.0.32.137"
62
+        "Resources": {
63
+            "NanoCPUs": 1000000000,
64
+            "MemoryBytes": 1039843328
93 65
         },
94
-        "ManagerStatus": {
95
-            "Leader": true,
96
-            "Reachability": "reachable",
97
-            "Addr": "168.0.32.137:2377"
66
+        "Engine": {
67
+            "EngineVersion": "1.12.0",
68
+            "Plugins": [
69
+                {
70
+                    "Type": "Volume",
71
+                    "Name": "local"
72
+                },
73
+                {
74
+                    "Type": "Network",
75
+                    "Name": "overlay"
76
+                },
77
+                {
78
+                    "Type": "Network",
79
+                    "Name": "null"
80
+                },
81
+                {
82
+                    "Type": "Network",
83
+                    "Name": "host"
84
+                },
85
+                {
86
+                    "Type": "Network",
87
+                    "Name": "bridge"
88
+                },
89
+                {
90
+                    "Type": "Network",
91
+                    "Name": "overlay"
92
+                }
93
+            ]
98 94
         }
95
+    },
96
+    "Status": {
97
+        "State": "ready",
98
+        "Addr": "168.0.32.137"
99
+    },
100
+    "ManagerStatus": {
101
+        "Leader": true,
102
+        "Reachability": "reachable",
103
+        "Addr": "168.0.32.137:2377"
99 104
     }
100
-    ]
101
-
102
-    {% raw %}
103
-    $ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
104
-    false
105
-    {% endraw %}
106
-
107
-    $ docker node inspect --pretty self
108
-    ID:                     e216jshn25ckzbvmwlnh5jr3g
109
-    Hostname:               swarm-manager
110
-    Joined at:              2016-06-16 22:52:44.9910662 +0000 utc
111
-    Status:
112
-     State:                 Ready
113
-     Availability:          Active
114
-     Address:               172.17.0.2
115
-    Manager Status:
116
-     Address:               172.17.0.2:2377
117
-     Raft Status:           Reachable
118
-     Leader:                Yes
119
-    Platform:
120
-     Operating System:      linux
121
-     Architecture:          x86_64
122
-    Resources:
123
-     CPUs:                  4
124
-     Memory:                7.704 GiB
125
-    Plugins:
126
-      Network:              overlay, bridge, null, host, overlay
127
-      Volume:               local
128
-    Engine Version:         1.12.0
129
-
130
-## Related information
105
+}
106
+]
107
+```
108
+
109
+### Specify an output format
110
+
111
+```none
112
+{% raw %}
113
+$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
114
+
115
+false
116
+
117
+$ docker node inspect --pretty self
118
+ID:                     e216jshn25ckzbvmwlnh5jr3g
119
+Hostname:               swarm-manager
120
+Joined at:              2016-06-16 22:52:44.9910662 +0000 utc
121
+Status:
122
+ State:                 Ready
123
+ Availability:          Active
124
+ Address:               172.17.0.2
125
+Manager Status:
126
+ Address:               172.17.0.2:2377
127
+ Raft Status:           Reachable
128
+ Leader:                Yes
129
+Platform:
130
+ Operating System:      linux
131
+ Architecture:          x86_64
132
+Resources:
133
+ CPUs:                  4
134
+ Memory:                7.704 GiB
135
+Plugins:
136
+  Network:              overlay, bridge, null, host, overlay
137
+  Volume:               local
138
+Engine Version:         1.12.0
139
+{% endraw %}
140
+```
141
+
142
+## Related commands
131 143
 
132 144
 * [node demote](node_demote.md)
133 145
 * [node ls](node_ls.md)
... ...
@@ -29,9 +29,13 @@ Options:
29 29
   -q, --quiet          Only display IDs
30 30
 ```
31 31
 
32
-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.
32
+## Description
33 33
 
34
-Example output:
34
+Lists all the nodes that the Docker Swarm manager knows about. You can filter
35
+using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section
36
+for more information about available filter options.
37
+
38
+## Examples
35 39
 
36 40
 ```bash
37 41
 $ docker node ls
... ...
@@ -42,7 +46,7 @@ ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATU
42 42
 e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
43 43
 ```
44 44
 
45
-## Filtering
45
+### Filtering
46 46
 
47 47
 The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
48 48
 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -55,7 +59,7 @@ The currently supported filters are:
55 55
 * [name](node_ls.md#name)
56 56
 * [role](node_ls.md#role)
57 57
 
58
-#### ID
58
+#### id
59 59
 
60 60
 The `id` filter matches all or part of a node's id.
61 61
 
... ...
@@ -66,7 +70,7 @@ ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
66 66
 1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Ready   Active
67 67
 ```
68 68
 
69
-#### Label
69
+#### label
70 70
 
71 71
 The `label` filter matches nodes based on engine labels and on the presence of a `label` alone or a `label` and a value. Node labels are currently not used for filtering.
72 72
 
... ...
@@ -79,7 +83,7 @@ ID                         HOSTNAME       STATUS  AVAILABILITY  MANAGER STATUS
79 79
 1bcef6utixb0l0ca7gxuivsj0  swarm-worker2  Ready   Active
80 80
 ```
81 81
 
82
-#### Membership
82
+#### membersip
83 83
 
84 84
 The `membership` filter matches nodes based on the presence of a `membership` and a value
85 85
 `accepted` or `pending`.
... ...
@@ -94,7 +98,7 @@ ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATU
94 94
 38ciaotwjuritcdtn9npbnkuz    swarm-worker1   Ready   Active
95 95
 ```
96 96
 
97
-#### Name
97
+#### name
98 98
 
99 99
 The `name` filter matches on all or part of a node hostname.
100 100
 
... ...
@@ -107,7 +111,7 @@ ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATU
107 107
 e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
108 108
 ```
109 109
 
110
-#### Role
110
+#### role
111 111
 
112 112
 The `role` filter matches nodes based on the presence of a `role` and a value `worker` or `manager`.
113 113
 
... ...
@@ -120,7 +124,7 @@ ID                           HOSTNAME        STATUS  AVAILABILITY  MANAGER STATU
120 120
 e216jshn25ckzbvmwlnh5jr3g *  swarm-manager1  Ready   Active        Leader
121 121
 ```
122 122
 
123
-## Related information
123
+## Related commands
124 124
 
125 125
 * [node demote](node_demote.md)
126 126
 * [node inspect](node_inspect.md)
... ...
@@ -24,14 +24,18 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
-Promotes a node to manager. This command targets a docker engine that is a manager in the swarm.
27
+## Description
28 28
 
29
+Promotes a node to manager. This command targets a docker engine that is a
30
+manager in the swarm.
31
+
32
+## Examples
29 33
 
30 34
 ```bash
31 35
 $ docker node promote <node name>
32 36
 ```
33 37
 
34
-## Related information
38
+## Related commands
35 39
 
36 40
 * [node demote](node_demote.md)
37 41
 * [node inspect](node_inspect.md)
... ...
@@ -28,20 +28,23 @@ Options:
28 28
       --no-trunc       Do not truncate output
29 29
 ```
30 30
 
31
-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.
31
+## Description
32 32
 
33
-Example output:
33
+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.
34 34
 
35
-    $ docker node ps swarm-manager1
36
-    NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
37
-    redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
38
-    redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
39
-    redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
40
-    redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
41
-    redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
35
+## Examples
42 36
 
37
+```bash
38
+$ docker node ps swarm-manager1
39
+NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
40
+redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
41
+redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
42
+redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
43
+redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
44
+redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
45
+```
43 46
 
44
-## Filtering
47
+### Filtering
45 48
 
46 49
 The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
47 50
 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -59,23 +62,27 @@ The `name` filter matches on all or part of a task's name.
59 59
 
60 60
 The following filter matches all tasks with a name containing the `redis` string.
61 61
 
62
-    $ docker node ps -f name=redis swarm-manager1
63
-    NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
64
-    redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
65
-    redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
66
-    redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
67
-    redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
68
-    redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
69
-
62
+```bash
63
+$ docker node ps -f name=redis swarm-manager1
64
+
65
+NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
66
+redis.1.7q92v0nr1hcgts2amcjyqg3pq   redis:3.0.6  swarm-manager1  Running        Running 5 hours
67
+redis.6.b465edgho06e318egmgjbqo4o   redis:3.0.6  swarm-manager1  Running        Running 29 seconds
68
+redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
69
+redis.9.dkkual96p4bb3s6b10r7coxxt   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
70
+redis.10.0tgctg8h8cech4w0k0gwrmr23  redis:3.0.6  swarm-manager1  Running        Running 5 seconds
71
+```
70 72
 
71 73
 #### id
72 74
 
73 75
 The `id` filter matches a task's id.
74 76
 
75
-    $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
76
-    NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
77
-    redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
77
+```bash
78
+$ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1
78 79
 
80
+NAME                                IMAGE        NODE            DESIRED STATE  CURRENT STATE
81
+redis.7.bg8c07zzg87di2mufeq51a2qp   redis:3.0.6  swarm-manager1  Running        Running 5 seconds
82
+```
79 83
 
80 84
 #### label
81 85
 
... ...
@@ -86,6 +93,7 @@ The following filter matches tasks with the `usage` label regardless of its valu
86 86
 
87 87
 ```bash
88 88
 $ docker node ps -f "label=usage"
89
+
89 90
 NAME                               IMAGE        NODE            DESIRED STATE  CURRENT STATE
90 91
 redis.6.b465edgho06e318egmgjbqo4o  redis:3.0.6  swarm-manager1  Running        Running 10 minutes
91 92
 redis.7.bg8c07zzg87di2mufeq51a2qp  redis:3.0.6  swarm-manager1  Running        Running 9 minutes
... ...
@@ -97,7 +105,7 @@ redis.7.bg8c07zzg87di2mufeq51a2qp  redis:3.0.6  swarm-manager1  Running        R
97 97
 The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
98 98
 
99 99
 
100
-## Related information
100
+## Related commands
101 101
 
102 102
 * [node demote](node_demote.md)
103 103
 * [node inspect](node_inspect.md)
... ...
@@ -28,33 +28,40 @@ Options:
28 28
       --help    Print usage
29 29
 ```
30 30
 
31
+## Description
32
+
31 33
 When run from a manager node, removes the specified nodes from a swarm.
32 34
 
33 35
 
34
-Example output:
36
+## Examples
37
+
38
+### Remove a stopped node from the swarm
35 39
 
36
-```nohighlight
40
+```bash
37 41
 $ docker node rm swarm-node-02
38 42
 
39 43
 Node swarm-node-02 removed from swarm
40 44
 ```
45
+### Attempt to remove a running node from a swarm
41 46
 
42 47
 Removes the specified nodes from the swarm, but only if the nodes are in the
43 48
 down state. If you attempt to remove an active node you will receive an error:
44 49
 
45
-```nohighlight
50
+```non
46 51
 $ docker node rm swarm-node-03
47 52
 
48 53
 Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
49 54
 down and can't be removed
50 55
 ```
51 56
 
57
+### Forcibly remove an inaccessible node from a swarm
58
+
52 59
 If you lose access to a worker node or need to shut it down because it has been
53 60
 compromised or is not behaving as expected, you can use the `--force` option.
54 61
 This may cause transient errors or interruptions, depending on the type of task
55 62
 being run on the node.
56 63
 
57
-```nohighlight
64
+```bash
58 65
 $ docker node rm --force swarm-node-03
59 66
 
60 67
 Node swarm-node-03 removed from swarm
... ...
@@ -63,7 +70,7 @@ Node swarm-node-03 removed from swarm
63 63
 A manager node must be demoted to a worker node (using `docker node demote`)
64 64
 before you can remove it from the swarm.
65 65
 
66
-## Related information
66
+## Related commands
67 67
 
68 68
 * [node demote](node_demote.md)
69 69
 * [node inspect](node_inspect.md)
... ...
@@ -13,7 +13,7 @@ keywords: "resources, update, dynamically"
13 13
      will be rejected.
14 14
 -->
15 15
 
16
-## update
16
+# update
17 17
 
18 18
 ```markdown
19 19
 Usage:  docker node update [OPTIONS] NODE
... ...
@@ -28,6 +28,12 @@ Options:
28 28
       --role string           Role of the node (worker/manager)
29 29
 ```
30 30
 
31
+## Description
32
+
33
+Update metadata about a node, such as its availability, labels, or roles.
34
+
35
+## Examples
36
+
31 37
 ### Add label metadata to a node
32 38
 
33 39
 Add metadata to a swarm node using node labels. You can specify a node label as
... ...
@@ -39,7 +45,7 @@ $ docker node update --label-add foo worker1
39 39
 
40 40
 To add multiple labels to a node, pass the `--label-add` flag for each label:
41 41
 
42
-``` bash
42
+```bash
43 43
 $ docker node update --label-add foo --label-add bar worker1
44 44
 ```
45 45
 
... ...
@@ -61,7 +67,7 @@ entity within the swarm. Do not confuse them with the docker daemon labels for
61 61
 For more information about labels, refer to [apply custom
62 62
 metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/).
63 63
 
64
-## Related information
64
+## Related commands
65 65
 
66 66
 * [node demote](node_demote.md)
67 67
 * [node inspect](node_inspect.md)
... ...
@@ -24,6 +24,8 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
+## Description
28
+
27 29
 The `docker pause` command suspends all processes in the specified containers.
28 30
 On Linux, this uses the cgroups freezer. Traditionally, when suspending a process
29 31
 the `SIGSTOP` signal is used, which is observable by the process being suspended.
... ...
@@ -35,6 +37,12 @@ See the
35 35
 [cgroups freezer documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt)
36 36
 for further details.
37 37
 
38
-## Related information
38
+## Examples
39
+
40
+```bash
41
+$ docker pause my_container
42
+```
43
+
44
+## Related commands
39 45
 
40 46
 * [unpause](unpause.md)
... ...
@@ -21,34 +21,38 @@ Usage:  docker plugin create [OPTIONS] PLUGIN PLUGIN-DATA-DIR
21 21
 Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory.
22 22
 
23 23
 Options:
24
-      --compress   Compress the context using gzip 
24
+      --compress   Compress the context using gzip
25 25
       --help       Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Creates a plugin. Before creating the plugin, prepare the plugin's root filesystem as well as
29 31
 [the config.json](../../extend/config.md)
30 32
 
33
+## Examples
31 34
 
32 35
 The following example shows how to create a sample `plugin`.
33 36
 
34 37
 ```bash
35
-
36 38
 $ ls -ls /home/pluginDir
37 39
 
38 40
 4 -rw-r--r--  1 root root 431 Nov  7 01:40 config.json
39 41
 0 drwxr-xr-x 19 root root 420 Nov  7 01:40 rootfs
40 42
 
41 43
 $ docker plugin create plugin /home/pluginDir
44
+
42 45
 plugin
43 46
 
44 47
 $ docker plugin ls
48
+
45 49
 ID                  NAME                TAG                 DESCRIPTION                  ENABLED
46 50
 672d8144ec02        plugin              latest              A sample plugin for Docker   false
47 51
 ```
48 52
 
49 53
 The plugin can subsequently be enabled for local use or pushed to the public registry.
50 54
 
51
-## Related information
55
+## Related commands
52 56
 
53 57
 * [plugin disable](plugin_disable.md)
54 58
 * [plugin enable](plugin_enable.md)
... ...
@@ -25,10 +25,13 @@ Options:
25 25
       --help    Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Disables a plugin. The plugin must be installed before it can be disabled,
29 31
 see [`docker plugin install`](plugin_install.md). Without the `-f` option,
30 32
 a plugin that has references (eg, volumes, networks) cannot be disabled.
31 33
 
34
+## Examples
32 35
 
33 36
 The following example shows that the `sample-volume-plugin` plugin is installed
34 37
 and enabled:
... ...
@@ -53,7 +56,7 @@ ID                  NAME                             TAG                 DESCRIP
53 53
 69553ca1d123        tiborvass/sample-volume-plugin   latest              A test plugin for Docker   false
54 54
 ```
55 55
 
56
-## Related information
56
+## Related commands
57 57
 
58 58
 * [plugin create](plugin_create.md)
59 59
 * [plugin enable](plugin_enable.md)
... ...
@@ -25,9 +25,12 @@ Options:
25 25
       --timeout int   HTTP client timeout (in seconds)
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Enables a plugin. The plugin must be installed before it can be enabled,
29 31
 see [`docker plugin install`](plugin_install.md).
30 32
 
33
+## Examples
31 34
 
32 35
 The following example shows that the `sample-volume-plugin` plugin is installed,
33 36
 but disabled:
... ...
@@ -52,7 +55,7 @@ ID                  NAME                             TAG                 DESCRIP
52 52
 69553ca1d123        tiborvass/sample-volume-plugin   latest              A test plugin for Docker   true
53 53
 ```
54 54
 
55
-## Related information
55
+## Related commands
56 56
 
57 57
 * [plugin create](plugin_create.md)
58 58
 * [plugin disable](plugin_disable.md)
... ...
@@ -25,15 +25,17 @@ Options:
25 25
       --help            Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Returns information about a plugin. By default, this command renders all results
29 31
 in a JSON array.
30 32
 
31
-Example output:
33
+## Examples
32 34
 
33
-```bash
35
+
36
+```none
34 37
 $ docker plugin inspect tiborvass/sample-volume-plugin:latest
35
-```
36
-```JSON
38
+
37 39
 {
38 40
   "Id": "8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21",
39 41
   "Name": "tiborvass/sample-volume-plugin:latest",
... ...
@@ -140,18 +142,21 @@ $ docker plugin inspect tiborvass/sample-volume-plugin:latest
140 140
   }
141 141
 }
142 142
 ```
143
+
143 144
 (output formatted for readability)
144 145
 
146
+### Formatting the output
145 147
 
146 148
 ```bash
149
+{% raw %}
147 150
 $ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
148
-```
149
-```
151
+
150 152
 8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21
153
+{% endraw %}
151 154
 ```
152 155
 
153 156
 
154
-## Related information
157
+## Related commands
155 158
 
156 159
 * [plugin create](plugin_create.md)
157 160
 * [plugin enable](plugin_enable.md)
... ...
@@ -28,16 +28,19 @@ Options:
28 28
       --help                    Print usage
29 29
 ```
30 30
 
31
+## Description
32
+
31 33
 Installs and enables a plugin. Docker looks first for the plugin on your Docker
32 34
 host. If the plugin does not exist locally, then the plugin is pulled from
33 35
 the registry. Note that the minimum required registry version to distribute
34 36
 plugins is 2.3.0
35 37
 
38
+## Examples
36 39
 
37
-The following example installs `vieus/sshfs` plugin and [set](plugin_set.md) it's env variable
38
-`DEBUG` to 1. Install consists of pulling the plugin from Docker Hub, prompting
39
-the user to accept the list of privileges that the plugin needs, settings parameters
40
- and enabling the plugin.
40
+The following example installs `vieus/sshfs` plugin and [sets](plugin_set.md) its
41
+`DEBUG` environment variable to `1`. To install, `pull` the plugin from Docker
42
+Hub and prompt the user to accept the list of privileges that the plugin needs,
43
+set the plugin's parameters and enable the plugin.
41 44
 
42 45
 ```bash
43 46
 $ docker plugin install vieux/sshfs DEBUG=1
... ...
@@ -59,7 +62,7 @@ ID                  NAME                  TAG                 DESCRIPTION
59 59
 69553ca1d123        vieux/sshfs           latest              sshFS plugin for Docker    true
60 60
 ```
61 61
 
62
-## Related information
62
+## Related commands
63 63
 
64 64
 * [plugin create](plugin_create.md)
65 65
 * [plugin disable](plugin_disable.md)
... ...
@@ -28,10 +28,12 @@ Options:
28 28
       --no-trunc   Don't truncate output
29 29
 ```
30 30
 
31
+## Description
32
+
31 33
 Lists all the plugins that are currently installed. You can install plugins
32 34
 using the [`docker plugin install`](plugin_install.md) command.
33 35
 
34
-Example output:
36
+## Examples
35 37
 
36 38
 ```bash
37 39
 $ docker plugin ls
... ...
@@ -40,7 +42,69 @@ ID                  NAME                             TAG                 DESCRIP
40 40
 69553ca1d123        tiborvass/sample-volume-plugin   latest              A test plugin for Docker   true
41 41
 ```
42 42
 
43
-## Related information
43
+### Filtering
44
+
45
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
46
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
47
+
48
+The currently supported filters are:
49
+
50
+* enabled (boolean - true or false, 0 or 1)
51
+* capability (string - currently `volumedriver`, `networkdriver`, `ipamdriver`, or `authz`)
52
+
53
+#### enabled
54
+
55
+The `enabled` filter matches on plugins enabled or disabled.
56
+
57
+#### capability
58
+
59
+The `capability` filter matches on plugin capabilities. One plugin
60
+might have multiple capabilities. Currently `volumedriver`, `networkdriver`,
61
+`ipamdriver`, and `authz` are supported capabilities.
62
+
63
+```bash
64
+$ docker plugin install --disable tiborvass/no-remove
65
+
66
+tiborvass/no-remove
67
+
68
+$ docker plugin ls --filter enabled=true
69
+
70
+NAME                  TAG                 DESCRIPTION                ENABLED
71
+```
72
+
73
+
74
+### Formatting
75
+
76
+The formatting options (`--format`) pretty-prints plugins output
77
+using a Go template.
78
+
79
+Valid placeholders for the Go template are listed below:
80
+
81
+Placeholder    | Description
82
+---------------|------------------------------------------------------------------------------------------
83
+`.ID`              | Plugin ID
84
+`.Name`            | Plugin name
85
+`.Description`     | Plugin description
86
+`.Enabled`         | Whether plugin is enabled or not
87
+`.PluginReference` | The reference used to push/pull from a registry
88
+
89
+When using the `--format` option, the `plugin ls` command will either
90
+output the data exactly as the template declares or, when using the
91
+`table` directive, includes column headers as well.
92
+
93
+The following example uses a template without headers and outputs the
94
+`ID` and `Name` entries separated by a colon for all plugins:
95
+
96
+```bash
97
+{% raw %}
98
+$ docker plugin ls --format "{{.ID}}: {{.Name}}"
99
+
100
+4be01827a72e: tiborvass/no-remove
101
+{% endraw %}
102
+```
103
+
104
+
105
+## Related commands
44 106
 
45 107
 * [plugin create](plugin_create.md)
46 108
 * [plugin disable](plugin_disable.md)
... ...
@@ -22,22 +22,27 @@ Options:
22 22
       --help       Print usage
23 23
 ```
24 24
 
25
-Use `docker plugin create` to create the plugin. Once the plugin is ready for distribution,
26
-use `docker plugin push` to share your images to the Docker Hub registry or to a self-hosted one.
25
+## Description
26
+
27
+After you have created a plugin using `docker plugin create` and the plugin is
28
+ready for distribution, use `docker plugin push` to share your images to Docker
29
+Hub or a self-hosted registry.
27 30
 
28 31
 Registry credentials are managed by [docker login](login.md).
29 32
 
33
+## Examples
34
+
30 35
 The following example shows how to push a sample `user/plugin`.
31 36
 
32 37
 ```bash
33
-
34 38
 $ docker plugin ls
39
+
35 40
 ID                  NAME                  TAG                 DESCRIPTION                ENABLED
36 41
 69553ca1d456        user/plugin           latest              A sample plugin for Docker false
37 42
 $ docker plugin push user/plugin
38 43
 ```
39 44
 
40
-## Related information
45
+## Related commands
41 46
 
42 47
 * [plugin create](plugin_create.md)
43 48
 * [plugin disable](plugin_disable.md)
... ...
@@ -28,12 +28,17 @@ Options:
28 28
           --help   Print usage
29 29
 ```
30 30
 
31
+## Description
32
+
31 33
 Removes a plugin. You cannot remove a plugin if it is enabled, you must disable
32 34
 a plugin using the [`docker plugin disable`](plugin_disable.md) before removing
33 35
 it (or use --force, use of force is not recommended, since it can affect
34 36
 functioning of running containers using the plugin).
35 37
 
36
-The following example disables and removes the `sample-volume-plugin:latest` plugin;
38
+## Examples
39
+
40
+The following example disables and removes the `sample-volume-plugin:latest`
41
+plugin:
37 42
 
38 43
 ```bash
39 44
 $ docker plugin disable tiborvass/sample-volume-plugin
... ...
@@ -43,7 +48,7 @@ $ docker plugin rm tiborvass/sample-volume-plugin:latest
43 43
 tiborvass/sample-volume-plugin
44 44
 ```
45 45
 
46
-## Related information
46
+## Related commands
47 47
 
48 48
 * [plugin create](plugin_create.md)
49 49
 * [plugin disable](plugin_disable.md)
... ...
@@ -24,6 +24,8 @@ Options:
24 24
       --help                    Print usage
25 25
 ```
26 26
 
27
+## Description
28
+
27 29
 Change settings for a plugin. The plugin must be disabled.
28 30
 
29 31
 The settings currently supported are:
... ...
@@ -32,23 +34,33 @@ The settings currently supported are:
32 32
  * path of devices
33 33
  * args
34 34
 
35
+## Examples
36
+
37
+### Change an environment variable
38
+
35 39
 The following example change the env variable `DEBUG` on the
36 40
 `sample-volume-plugin` plugin.
37 41
 
38 42
 ```bash
43
+{% raw %}
39 44
 $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
45
+
40 46
 [DEBUG=0]
41 47
 
42 48
 $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1
43 49
 
44 50
 $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
45 51
 [DEBUG=1]
52
+{% endraw %}
46 53
 ```
47 54
 
55
+### Change the source of a mount
56
+
48 57
 The following example change the source of the `mymount` mount on
49 58
 the `myplugin` plugin.
50 59
 
51 60
 ```bash
61
+{% raw %}
52 62
 $ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
53 63
 /foo
54 64
 
... ...
@@ -56,14 +68,19 @@ $ docker plugins set myplugin mymount.source=/bar
56 56
 
57 57
 $ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
58 58
 /bar
59
+{% endraw %}
59 60
 ```
60 61
 
61
-Note: since only `source` is settable in `mymount`, `docker plugins set mymount=/bar myplugin` would work too.
62
+> **Note**: Since only `source` is settable in `mymount`,
63
+> `docker plugins set mymount=/bar myplugin` would work too.
64
+
65
+### Change a device path
62 66
 
63 67
 The following example change the path of the `mydevice` device on
64 68
 the `myplugin` plugin.
65 69
 
66 70
 ```bash
71
+{% raw %}
67 72
 $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
68 73
 /dev/foo
69 74
 
... ...
@@ -71,13 +88,18 @@ $ docker plugins set myplugin mydevice.path=/dev/bar
71 71
 
72 72
 $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
73 73
 /dev/bar
74
+{% endraw %}
74 75
 ```
75 76
 
76
-Note: since only `path` is settable in `mydevice`, `docker plugins set mydevice=/dev/bar myplugin` would work too.
77
+> **Note**: Since only `path` is settable in `mydevice`,
78
+> `docker plugins set mydevice=/dev/bar myplugin` would work too.
79
+
80
+### Change the source of the arguments
77 81
 
78 82
 The following example change the source of the args on the `myplugin` plugin.
79 83
 
80 84
 ```bash
85
+{% raw %}
81 86
 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin
82 87
 ["foo", "bar"]
83 88
 
... ...
@@ -85,9 +107,10 @@ $ docker plugins set myplugin args="foo bar baz"
85 85
 
86 86
 $ docker plugin inspect -f '{{.Settings.Args}}' myplugin
87 87
 ["foo", "bar", "baz"]
88
+{% endraw %}
88 89
 ```
89 90
 
90
-## Related information
91
+## Related commands
91 92
 
92 93
 * [plugin create](plugin_create.md)
93 94
 * [plugin disable](plugin_disable.md)
... ...
@@ -27,11 +27,15 @@ Options:
27 27
       --skip-remote-check       Do not check if specified remote plugin matches existing plugin image
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Upgrades an existing plugin to the specified remote plugin image. If no remote
31 33
 is specified, Docker will re-pull the current image and use the updated version.
32 34
 All existing references to the plugin will continue to work.
33 35
 The plugin must be disabled before running the upgrade.
34 36
 
37
+## Examples
38
+
35 39
 The following example installs `vieus/sshfs` plugin, uses it to create and use
36 40
 a volume, then upgrades the plugin.
37 41
 
... ...
@@ -71,7 +75,7 @@ $ docker run -it -v sshvolume:/data alpine sh -c "ls /data"
71 71
 hello
72 72
 ```
73 73
 
74
-## Related information
74
+## Related commands
75 75
 
76 76
 * [plugin create](plugin_create.md)
77 77
 * [plugin disable](plugin_disable.md)
... ...
@@ -24,18 +24,24 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
+## Examples
28
+
29
+### Show all mapped ports
30
+
27 31
 You can find out all the ports mapped by not specifying a `PRIVATE_PORT`, or
28 32
 just a specific mapping:
29 33
 
30
-    $ docker ps
31
-    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES
32
-    b650456536c7        busybox:latest      top                 54 minutes ago      Up 54 minutes       0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp   test
33
-    $ docker port test
34
-    7890/tcp -> 0.0.0.0:4321
35
-    9876/tcp -> 0.0.0.0:1234
36
-    $ docker port test 7890/tcp
37
-    0.0.0.0:4321
38
-    $ docker port test 7890/udp
39
-    2014/06/24 11:53:36 Error: No public port '7890/udp' published for test
40
-    $ docker port test 7890
41
-    0.0.0.0:4321
34
+```bash
35
+$ docker ps
36
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES
37
+b650456536c7        busybox:latest      top                 54 minutes ago      Up 54 minutes       0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp   test
38
+$ docker port test
39
+7890/tcp -> 0.0.0.0:4321
40
+9876/tcp -> 0.0.0.0:1234
41
+$ docker port test 7890/tcp
42
+0.0.0.0:4321
43
+$ docker port test 7890/udp
44
+2014/06/24 11:53:36 Error: No public port '7890/udp' published for test
45
+$ docker port test 7890
46
+0.0.0.0:4321
47
+```
... ...
@@ -46,6 +46,10 @@ Options:
46 46
   -s, --size            Display total file sizes
47 47
 ```
48 48
 
49
+## Examples
50
+
51
+### Prevent truncating output
52
+
49 53
 Running `docker ps --no-trunc` showing 2 linked containers.
50 54
 
51 55
 ```bash
... ...
@@ -56,6 +60,8 @@ CONTAINER ID        IMAGE                        COMMAND                CREATED
56 56
 d7886598dbe2        crosbymichael/redis:latest   /redis-server --dir    33 minutes ago       Up 33 minutes       6379/tcp            redis,webapp/db
57 57
 ```
58 58
 
59
+### Show both running and stopped containers
60
+
59 61
 The `docker ps` command only shows running containers by default. To see all
60 62
 containers, use the `-a` (or `--all`) flag:
61 63
 
... ...
@@ -67,7 +73,7 @@ $ docker ps -a
67 67
 container that exposes TCP ports `100, 101, 102` displays `100-102/tcp` in
68 68
 the `PORTS` column.
69 69
 
70
-## Filtering
70
+### Filtering
71 71
 
72 72
 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
73 73
 than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -87,7 +93,7 @@ The currently supported filters are:
87 87
 * network (network id or name) - filters containers connected to the provided network
88 88
 * health (starting|healthy|unhealthy|none) - filters containers based on healthcheck status
89 89
 
90
-#### Label
90
+#### label
91 91
 
92 92
 The `label` filter matches containers based on the presence of a `label` alone or a `label` and a
93 93
 value.
... ...
@@ -111,7 +117,7 @@ CONTAINER ID        IMAGE               COMMAND             CREATED
111 111
 d85756f57265        busybox             "top"               About a minute ago   Up About a minute                       high_albattani
112 112
 ```
113 113
 
114
-#### Name
114
+#### name
115 115
 
116 116
 The `name` filter matches on all or part of a container's name.
117 117
 
... ...
@@ -135,7 +141,7 @@ CONTAINER ID        IMAGE               COMMAND             CREATED
135 135
 673394ef1d4c        busybox             "top"               38 minutes ago      Up 38 minutes                           nostalgic_shockley
136 136
 ```
137 137
 
138
-#### Exited
138
+#### exited
139 139
 
140 140
 The `exited` filter matches containers by exist status code. For example, to
141 141
 filter for containers that have exited successfully:
... ...
@@ -149,13 +155,14 @@ ea09c3c82f6e        registry:latest   /srv/run.sh            2 weeks ago
149 149
 48ee228c9464        fedora:20         bash                   2 weeks ago         Exited (0) 2 weeks ago                              tender_torvalds
150 150
 ```
151 151
 
152
-#### Killed containers
152
+#### Filter by exit signal
153 153
 
154 154
 You can use a filter to locate containers that exited with status of `137`
155 155
 meaning a `SIGKILL(9)` killed them.
156 156
 
157
-```bash
157
+```none
158 158
 $ docker ps -a --filter 'exited=137'
159
+
159 160
 CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS                       PORTS               NAMES
160 161
 b3e1c0ed5bfe        ubuntu:latest       "sleep 1000"           12 seconds ago      Exited (137) 5 seconds ago                       grave_kowalevski
161 162
 a2eb5558d669        redis:latest        "/entrypoint.sh redi   2 hours ago         Exited (137) 2 hours ago                         sharp_lalande
... ...
@@ -167,7 +174,7 @@ Any of these events result in a `137` status:
167 167
 * `docker kill` kills the container
168 168
 * Docker daemon restarts which kills all running containers
169 169
 
170
-#### Status
170
+#### status
171 171
 
172 172
 The `status` filter matches containers by status. You can filter using
173 173
 `created`, `restarting`, `running`, `removing`, `paused`, `exited` and `dead`. For example,
... ...
@@ -191,7 +198,7 @@ CONTAINER ID        IMAGE               COMMAND             CREATED
191 191
 673394ef1d4c        busybox             "top"               About an hour ago   Up About an hour (Paused)                       nostalgic_shockley
192 192
 ```
193 193
 
194
-#### Ancestor
194
+#### ancestor
195 195
 
196 196
 The `ancestor` filter matches containers based on its image or a descendant of
197 197
 it. The filter supports the following image representation:
... ...
@@ -244,7 +251,9 @@ CONTAINER ID        IMAGE               COMMAND             CREATED
244 244
 82a598284012        ubuntu:12.04.5      "top"               3 minutes ago        Up 3 minutes                            sleepy_bose
245 245
 ```
246 246
 
247
-#### Before
247
+#### Create time
248
+
249
+##### before
248 250
 
249 251
 The `before` filter shows only containers created before the container with
250 252
 given id or name. For example, having these containers created:
... ...
@@ -268,7 +277,7 @@ CONTAINER ID        IMAGE       COMMAND       CREATED              STATUS
268 268
 6e63f6ff38b0        busybox     "top"         About a minute ago   Up About a minute                      distracted_fermat
269 269
 ```
270 270
 
271
-#### Since
271
+##### since
272 272
 
273 273
 The `since` filter shows only containers created since the container with given
274 274
 id or name. For example, with the same containers as in `before` filter:
... ...
@@ -281,12 +290,13 @@ CONTAINER ID        IMAGE       COMMAND       CREATED             STATUS
281 281
 4aace5031105        busybox     "top"         10 minutes ago      Up 10 minutes                           focused_hamilton
282 282
 ```
283 283
 
284
-#### Volume
284
+#### volume
285 285
 
286 286
 The `volume` filter shows only containers that mount a specific volume or have
287 287
 a volume mounted in a specific path:
288 288
 
289
-```bash{% raw %}
289
+```bash
290
+{% raw %}
290 291
 $ docker ps --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}"
291 292
 CONTAINER ID        MOUNTS
292 293
 9c3527ed70ce        remote-volume
... ...
@@ -294,9 +304,10 @@ CONTAINER ID        MOUNTS
294 294
 $ docker ps --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}"
295 295
 CONTAINER ID        MOUNTS
296 296
 9c3527ed70ce        remote-volume
297
-{% endraw %}```
297
+{% endraw %}
298
+```
298 299
 
299
-#### Network
300
+#### network
300 301
 
301 302
 The `network` filter shows only containers that are connected to a network with
302 303
 a given name or id.
... ...
@@ -331,7 +342,45 @@ CONTAINER ID        IMAGE       COMMAND       CREATED             STATUS
331 331
 9d4893ed80fe        ubuntu      "top"         10 minutes ago      Up 10 minutes                           test1
332 332
 ```
333 333
 
334
-## Formatting
334
+#### publish and expose
335
+
336
+The `publish` and `expose` filters show only containers that have published or exposed port with a given port
337
+number, port range, and/or protocol. The default protocol is `tcp` when not specified.
338
+
339
+The following filter matches all containers that have published port of 80:
340
+
341
+```bash
342
+$ docker run -d --publish=80 busybox top
343
+$ docker run -d --expose=8080 busybox top
344
+
345
+$ docker ps -a
346
+
347
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                   NAMES
348
+9833437217a5        busybox             "top"               5 seconds ago       Up 4 seconds        8080/tcp                dreamy_mccarthy
349
+fc7e477723b7        busybox             "top"               50 seconds ago      Up 50 seconds       0.0.0.0:32768->80/tcp   admiring_roentgen
350
+
351
+$ docker ps --filter publish=80
352
+
353
+CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS                   NAMES
354
+fc7e477723b7        busybox             "top"               About a minute ago   Up About a minute   0.0.0.0:32768->80/tcp   admiring_roentgen
355
+```
356
+
357
+The following filter matches all containers that have exposed TCP port in the range of `8000-8080`:
358
+```bash
359
+$ docker ps --filter expose=8000-8080/tcp
360
+
361
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
362
+9833437217a5        busybox             "top"               21 seconds ago      Up 19 seconds       8080/tcp            dreamy_mccarthy
363
+```
364
+
365
+The following filter matches all containers that have exposed UDP port `80`:
366
+```bash
367
+$ docker ps --filter publish=80/udp
368
+
369
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
370
+```
371
+
372
+### Formatting
335 373
 
336 374
 The formatting option (`--format`) pretty-prints container output using a Go
337 375
 template.
... ...
@@ -26,6 +26,8 @@ Options:
26 26
       --help                    Print usage
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 Most of your images will be created on top of a base image from the
30 32
 [Docker Hub](https://hub.docker.com) registry.
31 33
 
... ...
@@ -35,7 +37,7 @@ can `pull` and try without needing to define and configure your own.
35 35
 To download a particular image, or set of images (i.e., a repository),
36 36
 use `docker pull`.
37 37
 
38
-## Proxy configuration
38
+### Proxy configuration
39 39
 
40 40
 If you are behind an HTTP proxy server, for example in corporate settings,
41 41
 before open a connect to registry, you may need to configure the Docker
... ...
@@ -44,7 +46,7 @@ environment variables. To set these environment variables on a host using
44 44
 `systemd`, refer to the [control and configure Docker with systemd](https://docs.docker.com/engine/admin/systemd/#http-proxy)
45 45
 for variables configuration.
46 46
 
47
-## Concurrent downloads
47
+### Concurrent downloads
48 48
 
49 49
 By default the Docker daemon will pull three layers of an image at a time.
50 50
 If you are on a low bandwidth connection this may cause timeout issues and you may want to lower
... ...
@@ -110,7 +112,7 @@ For more information about images, layers, and the content-addressable store,
110 110
 refer to [understand images, containers, and storage drivers](https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/).
111 111
 
112 112
 
113
-## Pull an image by digest (immutable identifier)
113
+### Pull an image by digest (immutable identifier)
114 114
 
115 115
 So far, you've pulled images by their name (and "tag"). Using names and tags is
116 116
 a convenient way to work with images. When using tags, you can `docker pull` an
... ...
@@ -175,7 +177,7 @@ MAINTAINER some maintainer <maintainer@example.com>
175 175
 > digest accordingly.
176 176
 
177 177
 
178
-## Pulling from a different registry
178
+### Pull from a different registry
179 179
 
180 180
 By default, `docker pull` pulls images from [Docker Hub](https://hub.docker.com). It is also possible to
181 181
 manually specify the path of a registry to pull from. For example, if you have
... ...
@@ -196,7 +198,7 @@ registry is allowed to be accessed over an insecure connection. Refer to the
196 196
 [insecure registries](dockerd.md#insecure-registries) section for more information.
197 197
 
198 198
 
199
-## Pull a repository with multiple images
199
+### Pull a repository with multiple images
200 200
 
201 201
 By default, `docker pull` pulls a *single* image from the registry. A repository
202 202
 can contain multiple images. To pull all images from a repository, provide the
... ...
@@ -231,7 +233,7 @@ fedora       heisenbug   105182bb5e8b    5 days ago   372.7 MB
231 231
 fedora       latest      105182bb5e8b    5 days ago   372.7 MB
232 232
 ```
233 233
 
234
-## Canceling a pull
234
+### Cancel a pull
235 235
 
236 236
 Killing the `docker pull` process, for example by pressing `CTRL-c` while it is
237 237
 running in a terminal, will terminate the pull operation.
... ...
@@ -25,6 +25,8 @@ Options:
25 25
       --help                    Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Use `docker push` to share your images to the [Docker Hub](https://hub.docker.com)
29 31
 registry or to a self-hosted one.
30 32
 
... ...
@@ -36,7 +38,7 @@ running in a terminal, terminates the push operation.
36 36
 
37 37
 Registry credentials are managed by [docker login](login.md).
38 38
 
39
-## Concurrent uploads
39
+### Concurrent uploads
40 40
 
41 41
 By default the Docker daemon will push five layers of an image at a time.
42 42
 If you are on a low bandwidth connection this may cause timeout issues and you may want to lower
... ...
@@ -45,7 +47,7 @@ this via the `--max-concurrent-uploads` daemon option. See the
45 45
 
46 46
 ## Examples
47 47
 
48
-### Pushing a new image to a registry
48
+### Push a new image to a registry
49 49
 
50 50
 First save the new image by finding the container ID (using [`docker ps`](ps.md))
51 51
 and then committing it to a new image name.  Note that only `a-z0-9-_.` are
... ...
@@ -62,6 +64,7 @@ registry:
62 62
 
63 63
 ```bash
64 64
 $ docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd
65
+
65 66
 $ docker push registry-host:5000/myadmin/rhel-httpd
66 67
 ```
67 68
 
... ...
@@ -24,4 +24,12 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
-The `docker rename` command allows the container to be renamed to a different name.
27
+## Description
28
+
29
+The `docker rename` command renames a container.
30
+
31
+## Examples
32
+
33
+```bash
34
+$ docker rename my_container my_new_container
35
+```
... ...
@@ -24,3 +24,9 @@ Options:
24 24
       --help       Print usage
25 25
   -t, --time int   Seconds to wait for stop before killing the container (default 10)
26 26
 ```
27
+
28
+## Examples
29
+
30
+```bash
31
+$ docker restart my_container
32
+```
... ...
@@ -29,40 +29,71 @@ Options:
29 29
 
30 30
 ## Examples
31 31
 
32
-    $ docker rm /redis
33
-    /redis
32
+### Remove a container
34 33
 
35 34
 This will remove the container referenced under the link
36 35
 `/redis`.
37 36
 
38
-    $ docker rm --link /webapp/redis
39
-    /webapp/redis
37
+```bash
38
+$ docker rm /redis
39
+
40
+/redis
41
+```
42
+
43
+### Remove a link specified with `--link` on the default bridge network
40 44
 
41 45
 This will remove the underlying link between `/webapp` and the `/redis`
42
-containers removing all network communication.
46
+containers on the default bridge network, removing all network communication
47
+between the two containers. This does not apply when `--link` is used with
48
+user-specified networks.
49
+
50
+```bash
51
+$ docker rm --link /webapp/redis
52
+
53
+/webapp/redis
54
+```
55
+
56
+### Force-remove a running container
57
+
58
+This command will force-remove a running container.
43 59
 
44
-    $ docker rm --force redis
45
-    redis
60
+```bash
61
+$ docker rm --force redis
46 62
 
47
-The main process inside the container referenced under the link `/redis` will receive
63
+redis
64
+```
65
+
66
+The main process inside the container referenced under the link `redis` will receive
48 67
 `SIGKILL`, then the container will be removed.
49 68
 
50
-    $ docker rm $(docker ps -a -q)
69
+### Remove all stopped containers
70
+
71
+```bash
72
+$ docker rm $(docker ps -a -q)
73
+```
51 74
 
52 75
 This command will delete all stopped containers. The command
53 76
 `docker ps -a -q` will return all existing container IDs and pass them to
54 77
 the `rm` command which will delete them. Any running containers will not be
55 78
 deleted.
56 79
 
57
-    $ docker rm -v redis
58
-    redis
80
+### Remove a container and its volumes
81
+
82
+```bash
83
+$ docker rm -v redis
84
+redis
85
+```
59 86
 
60 87
 This command will remove the container and any volumes associated with it.
61 88
 Note that if a volume was specified with a name, it will not be removed.
62 89
 
63
-    $ docker create -v awesome:/foo -v /bar --name hello redis
64
-    hello
65
-    $ docker rm -v hello
90
+### Remove a container and selectively remove volumes
91
+
92
+```bash
93
+$ docker create -v awesome:/foo -v /bar --name hello redis
94
+hello
95
+$ docker rm -v hello
96
+```
66 97
 
67 98
 In this example, the volume for `/foo` will remain intact, but the volume for
68 99
 `/bar` will be removed. The same behavior holds for volumes inherited with
... ...
@@ -26,58 +26,80 @@ Options:
26 26
       --no-prune   Do not delete untagged parents
27 27
 ```
28 28
 
29
+## Examples
30
+
29 31
 You can remove an image using its short or long ID, its tag, or its digest. If
30 32
 an image has one or more tag referencing it, you must remove all of them before
31 33
 the image is removed. Digest references are removed automatically when an image
32 34
 is removed by tag.
33 35
 
34
-    $ docker images
35
-    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
36
-    test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
37
-    test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
38
-    test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
36
+```bash
37
+$ docker images
38
+
39
+REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
40
+test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
41
+test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
42
+test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
43
+
44
+$ docker rmi fd484f19954f
45
+
46
+Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories, use -f to force
47
+2013/12/11 05:47:16 Error: failed to remove one or more images
48
+
49
+$ docker rmi test1
50
+
51
+Untagged: test1:latest
52
+
53
+$ docker rmi test2
54
+
55
+Untagged: test2:latest
56
+
39 57
 
40
-    $ docker rmi fd484f19954f
41
-    Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories, use -f to force
42
-    2013/12/11 05:47:16 Error: failed to remove one or more images
58
+$ docker images
43 59
 
44
-    $ docker rmi test1
45
-    Untagged: test1:latest
46
-    $ docker rmi test2
47
-    Untagged: test2:latest
60
+REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
61
+test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
48 62
 
49
-    $ docker images
50
-    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
51
-    test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
52
-    $ docker rmi test
53
-    Untagged: test:latest
54
-    Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
63
+$ docker rmi test
64
+
65
+Untagged: test:latest
66
+Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
67
+```
55 68
 
56 69
 If you use the `-f` flag and specify the image's short or long ID, then this
57 70
 command untags and removes all images that match the specified ID.
58 71
 
59
-    $ docker images
60
-    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
61
-    test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
62
-    test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
63
-    test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
72
+```bash
73
+$ docker images
74
+
75
+REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
76
+test1                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
77
+test                      latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
78
+test2                     latest              fd484f19954f        23 seconds ago      7 B (virtual 4.964 MB)
79
+
80
+$ docker rmi -f fd484f19954f
64 81
 
65
-    $ docker rmi -f fd484f19954f
66
-    Untagged: test1:latest
67
-    Untagged: test:latest
68
-    Untagged: test2:latest
69
-    Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
82
+Untagged: test1:latest
83
+Untagged: test:latest
84
+Untagged: test2:latest
85
+Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8
86
+```
70 87
 
71 88
 An image pulled by digest has no tag associated with it:
72 89
 
73
-    $ docker images --digests
74
-    REPOSITORY                     TAG       DIGEST                                                                    IMAGE ID        CREATED         SIZE
75
-    localhost:5000/test/busybox    <none>    sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536    9 weeks ago     2.43 MB
90
+```bash
91
+$ docker images --digests
92
+
93
+REPOSITORY                     TAG       DIGEST                                                                    IMAGE ID        CREATED         SIZE
94
+localhost:5000/test/busybox    <none>    sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf   4986bf8c1536    9 weeks ago     2.43 MB
95
+```
76 96
 
77 97
 To remove an image using its digest:
78 98
 
79
-    $ docker rmi localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
80
-    Untagged: localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
81
-    Deleted: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125
82
-    Deleted: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
83
-    Deleted: df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b
99
+```bash
100
+$ docker rmi localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
101
+Untagged: localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
102
+Deleted: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125
103
+Deleted: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2
104
+Deleted: df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b
105
+```
... ...
@@ -144,6 +144,8 @@ Options:
144 144
   -w, --workdir string              Working directory inside the container
145 145
 ```
146 146
 
147
+## Descriptino
148
+
147 149
 The `docker run` command first `creates` a writeable container layer over the
148 150
 specified image, and then `starts` it using the specified command. That is,
149 151
 `docker run` is equivalent to the API `/containers/create` then
... ...
@@ -160,12 +162,15 @@ For information on connecting a container to a network, see the ["*Docker networ
160 160
 
161 161
 ### Assign name and allocate pseudo-TTY (--name, -it)
162 162
 
163
-    $ docker run --name test -it debian
164
-    root@d6c0fe130dba:/# exit 13
165
-    $ echo $?
166
-    13
167
-    $ docker ps -a | grep test
168
-    d6c0fe130dba        debian:7            "/bin/bash"         26 seconds ago      Exited (13) 17 seconds ago                         test
163
+```bash
164
+$ docker run --name test -it debian
165
+
166
+root@d6c0fe130dba:/# exit 13
167
+$ echo $?
168
+13
169
+$ docker ps -a | grep test
170
+d6c0fe130dba        debian:7            "/bin/bash"         26 seconds ago      Exited (13) 17 seconds ago                         test
171
+```
169 172
 
170 173
 This example runs a container named `test` using the `debian:latest`
171 174
 image. The `-it` instructs Docker to allocate a pseudo-TTY connected to
... ...
@@ -176,7 +181,9 @@ In the example, the `bash` shell is quit by entering
176 176
 
177 177
 ### Capture container ID (--cidfile)
178 178
 
179
-    $ docker run --cidfile /tmp/docker_test.cid ubuntu echo "test"
179
+```bash
180
+$ docker run --cidfile /tmp/docker_test.cid ubuntu echo "test"
181
+```
180 182
 
181 183
 This will create a container and print `test` to the console. The `cidfile`
182 184
 flag makes Docker attempt to create a new file and write the container ID to it.
... ...
@@ -185,19 +192,23 @@ file when `docker run` exits.
185 185
 
186 186
 ### Full container capabilities (--privileged)
187 187
 
188
-    $ docker run -t -i --rm ubuntu bash
189
-    root@bc338942ef20:/# mount -t tmpfs none /mnt
190
-    mount: permission denied
188
+```bash
189
+$ docker run -t -i --rm ubuntu bash
190
+root@bc338942ef20:/# mount -t tmpfs none /mnt
191
+mount: permission denied
192
+```
191 193
 
192 194
 This will *not* work, because by default, most potentially dangerous kernel
193 195
 capabilities are dropped; including `cap_sys_admin` (which is required to mount
194 196
 filesystems). However, the `--privileged` flag will allow it to run:
195 197
 
196
-    $ docker run -t -i --privileged ubuntu bash
197
-    root@50e3f57e16e6:/# mount -t tmpfs none /mnt
198
-    root@50e3f57e16e6:/# df -h
199
-    Filesystem      Size  Used Avail Use% Mounted on
200
-    none            1.9G     0  1.9G   0% /mnt
198
+```bash
199
+$ docker run -t -i --privileged ubuntu bash
200
+root@50e3f57e16e6:/# mount -t tmpfs none /mnt
201
+root@50e3f57e16e6:/# df -h
202
+Filesystem      Size  Used Avail Use% Mounted on
203
+none            1.9G     0  1.9G   0% /mnt
204
+```
201 205
 
202 206
 The `--privileged` flag gives *all* capabilities to the container, and it also
203 207
 lifts all the limitations enforced by the `device` cgroup controller. In other
... ...
@@ -206,14 +217,18 @@ flag exists to allow special use-cases, like running Docker within Docker.
206 206
 
207 207
 ### Set working directory (-w)
208 208
 
209
-    $ docker  run -w /path/to/dir/ -i -t  ubuntu pwd
209
+```bash
210
+$ docker  run -w /path/to/dir/ -i -t  ubuntu pwd
211
+```
210 212
 
211 213
 The `-w` lets the command being executed inside directory given, here
212 214
 `/path/to/dir/`. If the path does not exist it is created inside the container.
213 215
 
214 216
 ### Set storage driver options per container
215 217
 
216
-    $ docker run -it --storage-opt size=120G fedora /bin/bash
218
+```bash
219
+$ docker run -it --storage-opt size=120G fedora /bin/bash
220
+```
217 221
 
218 222
 This (size) will allow to set the container rootfs size to 120G at creation time.
219 223
 This option is only available for the `devicemapper`, `btrfs`, `overlay2`,
... ...
@@ -226,14 +241,18 @@ Under these conditions, user can pass any size less then the backing fs size.
226 226
 
227 227
 ### Mount tmpfs (--tmpfs)
228 228
 
229
-    $ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image
229
+```bash
230
+$ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image
231
+```
230 232
 
231 233
 The `--tmpfs` flag mounts an empty tmpfs into the container with the `rw`,
232 234
 `noexec`, `nosuid`, `size=65536k` options.
233 235
 
234 236
 ### Mount volume (-v, --read-only)
235 237
 
236
-    $ docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu pwd
238
+```bash
239
+$ docker  run  -v `pwd`:`pwd` -w `pwd` -i -t  ubuntu pwd
240
+```
237 241
 
238 242
 The `-v` flag mounts the current working directory into the container. The `-w`
239 243
 lets the command being executed inside the current working directory, by
... ...
@@ -241,21 +260,27 @@ changing into the directory to the value returned by `pwd`. So this
241 241
 combination executes the command using the container, but inside the
242 242
 current working directory.
243 243
 
244
-    $ docker run -v /doesnt/exist:/foo -w /foo -i -t ubuntu bash
244
+```bash
245
+$ docker run -v /doesnt/exist:/foo -w /foo -i -t ubuntu bash
246
+```
245 247
 
246 248
 When the host directory of a bind-mounted volume doesn't exist, Docker
247 249
 will automatically create this directory on the host for you. In the
248 250
 example above, Docker will create the `/doesnt/exist`
249 251
 folder before starting your container.
250 252
 
251
-    $ docker run --read-only -v /icanwrite busybox touch /icanwrite/here
253
+```bash
254
+$ docker run --read-only -v /icanwrite busybox touch /icanwrite/here
255
+```
252 256
 
253 257
 Volumes can be used in combination with `--read-only` to control where
254 258
 a container writes files. The `--read-only` flag mounts the container's root
255 259
 filesystem as read only prohibiting writes to locations other than the
256 260
 specified volumes for the container.
257 261
 
258
-    $ docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/static-docker-binary:/usr/bin/docker busybox sh
262
+```bash
263
+$ docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/static-docker-binary:/usr/bin/docker busybox sh
264
+```
259 265
 
260 266
 By bind-mounting the docker unix socket and statically linked docker
261 267
 binary (refer to [get the linux binary](
... ...
@@ -263,45 +288,55 @@ https://docs.docker.com/engine/installation/binaries/#/get-the-linux-binary)),
263 263
 you give the container the full access to create and manipulate the host's
264 264
 Docker daemon.
265 265
 
266
-On Windows, the paths must be specified using Windows-style semantics. 
266
+On Windows, the paths must be specified using Windows-style semantics.
267 267
 
268
-    PS C:\> docker run -v c:\foo:c:\dest microsoft/nanoserver cmd /s /c type c:\dest\somefile.txt
269
-    Contents of file
270
-	
271
-    PS C:\> docker run -v c:\foo:d: microsoft/nanoserver cmd /s /c type d:\somefile.txt
272
-    Contents of file
268
+```powershell
269
+PS C:\> docker run -v c:\foo:c:\dest microsoft/nanoserver cmd /s /c type c:\dest\somefile.txt
270
+Contents of file
273 271
 
274
-The following examples will fail when using Windows-based containers, as the 
275
-destination of a volume or bind-mount inside the container must be one of: 
272
+PS C:\> docker run -v c:\foo:d: microsoft/nanoserver cmd /s /c type d:\somefile.txt
273
+Contents of file
274
+```
275
+
276
+The following examples will fail when using Windows-based containers, as the
277
+destination of a volume or bind-mount inside the container must be one of:
276 278
 a non-existing or empty directory; or a drive other than C:. Further, the source
277 279
 of a bind mount must be a local directory, not a file.
278 280
 
279
-    net use z: \\remotemachine\share
280
-    docker run -v z:\foo:c:\dest ...
281
-    docker run -v \\uncpath\to\directory:c:\dest ...
282
-    docker run -v c:\foo\somefile.txt:c:\dest ...
283
-    docker run -v c:\foo:c: ...
284
-    docker run -v c:\foo:c:\existing-directory-with-contents ...
281
+```powershell
282
+net use z: \\remotemachine\share
283
+docker run -v z:\foo:c:\dest ...
284
+docker run -v \\uncpath\to\directory:c:\dest ...
285
+docker run -v c:\foo\somefile.txt:c:\dest ...
286
+docker run -v c:\foo:c: ...
287
+docker run -v c:\foo:c:\existing-directory-with-contents ...
288
+```
285 289
 
286 290
 For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/engine/tutorials/dockervolumes/)
287 291
 
288 292
 ### Publish or expose port (-p, --expose)
289 293
 
290
-    $ docker run -p 127.0.0.1:80:8080 ubuntu bash
294
+```bash
295
+$ docker run -p 127.0.0.1:80:8080 ubuntu bash
296
+```
291 297
 
292 298
 This binds port `8080` of the container to port `80` on `127.0.0.1` of the host
293 299
 machine. The [Docker User
294 300
 Guide](https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/)
295 301
 explains in detail how to manipulate ports in Docker.
296 302
 
297
-    $ docker run --expose 80 ubuntu bash
303
+```bash
304
+$ docker run --expose 80 ubuntu bash
305
+```
298 306
 
299 307
 This exposes port `80` of the container without publishing the port to the host
300 308
 system's interfaces.
301 309
 
302 310
 ### Set environment variables (-e, --env, --env-file)
303 311
 
304
-    $ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
312
+```bash
313
+$ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
314
+```
305 315
 
306 316
 This sets simple (non-array) environmental variables in the container. For
307 317
 illustration all three
... ...
@@ -317,10 +352,12 @@ Regardless of the order of these three flags, the `--env-file` are processed
317 317
 first, and then `-e`, `--env` flags. This way, the `-e` or `--env` will
318 318
 override variables as needed.
319 319
 
320
-    $ cat ./env.list
321
-    TEST_FOO=BAR
322
-    $ docker run --env TEST_FOO="This is a test" --env-file ./env.list busybox env | grep TEST_FOO
323
-    TEST_FOO=This is a test
320
+```bash
321
+$ cat ./env.list
322
+TEST_FOO=BAR
323
+$ docker run --env TEST_FOO="This is a test" --env-file ./env.list busybox env | grep TEST_FOO
324
+TEST_FOO=This is a test
325
+```
324 326
 
325 327
 The `--env-file` flag takes a filename as an argument and expects each line
326 328
 to be in the `VAR=VAL` format, mimicking the argument passed to `--env`. Comment
... ...
@@ -328,53 +365,57 @@ lines need only be prefixed with `#`
328 328
 
329 329
 An example of a file passed with `--env-file`
330 330
 
331
-    $ cat ./env.list
332
-    TEST_FOO=BAR
333
-
334
-    # this is a comment
335
-    TEST_APP_DEST_HOST=10.10.0.127
336
-    TEST_APP_DEST_PORT=8888
337
-    _TEST_BAR=FOO
338
-    TEST_APP_42=magic
339
-    helloWorld=true
340
-    123qwe=bar
341
-    org.spring.config=something
342
-
343
-    # pass through this variable from the caller
344
-    TEST_PASSTHROUGH
345
-    $ TEST_PASSTHROUGH=howdy docker run --env-file ./env.list busybox env
346
-    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
347
-    HOSTNAME=5198e0745561
348
-    TEST_FOO=BAR
349
-    TEST_APP_DEST_HOST=10.10.0.127
350
-    TEST_APP_DEST_PORT=8888
351
-    _TEST_BAR=FOO
352
-    TEST_APP_42=magic
353
-    helloWorld=true
354
-    TEST_PASSTHROUGH=howdy
355
-    HOME=/root
356
-    123qwe=bar
357
-    org.spring.config=something
358
-
359
-    $ docker run --env-file ./env.list busybox env
360
-    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
361
-    HOSTNAME=5198e0745561
362
-    TEST_FOO=BAR
363
-    TEST_APP_DEST_HOST=10.10.0.127
364
-    TEST_APP_DEST_PORT=8888
365
-    _TEST_BAR=FOO
366
-    TEST_APP_42=magic
367
-    helloWorld=true
368
-    TEST_PASSTHROUGH=
369
-    HOME=/root
370
-    123qwe=bar
371
-    org.spring.config=something
331
+```bash
332
+$ cat ./env.list
333
+TEST_FOO=BAR
334
+
335
+# this is a comment
336
+TEST_APP_DEST_HOST=10.10.0.127
337
+TEST_APP_DEST_PORT=8888
338
+_TEST_BAR=FOO
339
+TEST_APP_42=magic
340
+helloWorld=true
341
+123qwe=bar
342
+org.spring.config=something
343
+
344
+# pass through this variable from the caller
345
+TEST_PASSTHROUGH
346
+$ TEST_PASSTHROUGH=howdy docker run --env-file ./env.list busybox env
347
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
348
+HOSTNAME=5198e0745561
349
+TEST_FOO=BAR
350
+TEST_APP_DEST_HOST=10.10.0.127
351
+TEST_APP_DEST_PORT=8888
352
+_TEST_BAR=FOO
353
+TEST_APP_42=magic
354
+helloWorld=true
355
+TEST_PASSTHROUGH=howdy
356
+HOME=/root
357
+123qwe=bar
358
+org.spring.config=something
359
+
360
+$ docker run --env-file ./env.list busybox env
361
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
362
+HOSTNAME=5198e0745561
363
+TEST_FOO=BAR
364
+TEST_APP_DEST_HOST=10.10.0.127
365
+TEST_APP_DEST_PORT=8888
366
+_TEST_BAR=FOO
367
+TEST_APP_42=magic
368
+helloWorld=true
369
+TEST_PASSTHROUGH=
370
+HOME=/root
371
+123qwe=bar
372
+org.spring.config=something
373
+```
372 374
 
373 375
 ### Set metadata on container (-l, --label, --label-file)
374 376
 
375 377
 A label is a `key=value` pair that applies metadata to a container. To label a container with two labels:
376 378
 
377
-    $ docker run -l my-label --label com.example.foo=bar ubuntu bash
379
+```bash
380
+$ docker run -l my-label --label com.example.foo=bar ubuntu bash
381
+```
378 382
 
379 383
 The `my-label` key doesn't specify a value so the label defaults to an empty
380 384
 string(`""`). To add multiple labels, repeat the label flag (`-l` or `--label`).
... ...
@@ -387,18 +428,22 @@ Use the `--label-file` flag to load multiple labels from a file. Delimit each
387 387
 label in the file with an EOL mark. The example below loads labels from a
388 388
 labels file in the current directory:
389 389
 
390
-    $ docker run --label-file ./labels ubuntu bash
390
+```bash
391
+$ docker run --label-file ./labels ubuntu bash
392
+```
391 393
 
392 394
 The label-file format is similar to the format for loading environment
393 395
 variables. (Unlike environment variables, labels are not visible to processes
394 396
 running inside a container.) The following example illustrates a label-file
395 397
 format:
396 398
 
397
-    com.example.label1="a label"
399
+```none
400
+com.example.label1="a label"
398 401
 
399
-    # this is a comment
400
-    com.example.label2=another\ label
401
-    com.example.label3
402
+# this is a comment
403
+com.example.label2=another\ label
404
+com.example.label3
405
+```
402 406
 
403 407
 You can load multiple label-files by supplying multiple  `--label-file` flags.
404 408
 
... ...
@@ -430,16 +475,18 @@ or name. For `overlay` networks or custom plugins that support multi-host
430 430
 connectivity, containers connected to the same multi-host network but launched
431 431
 from different Engines can also communicate in this way.
432 432
 
433
-**Note**: Service discovery is unavailable on the default bridge network.
434
-Containers can communicate via their IP addresses by default. To communicate
435
-by name, they must be linked.
433
+> **Note**: Service discovery is unavailable on the default bridge network.
434
+> Containers can communicate via their IP addresses by default. To communicate
435
+> by name, they must be linked.
436 436
 
437 437
 You can disconnect a container from a network using the `docker network
438 438
 disconnect` command.
439 439
 
440 440
 ### Mount volumes from container (--volumes-from)
441 441
 
442
-    $ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd
442
+```bash
443
+$ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd
444
+```
443 445
 
444 446
 The `--volumes-from` flag mounts all the defined volumes from the referenced
445 447
 containers. Containers can be specified by repetitions of the `--volumes-from`
... ...
@@ -467,18 +514,24 @@ The `-a` flag tells `docker run` to bind to the container's `STDIN`, `STDOUT`
467 467
 or `STDERR`. This makes it possible to manipulate the output and input as
468 468
 needed.
469 469
 
470
-    $ echo "test" | docker run -i -a stdin ubuntu cat -
470
+```bash
471
+$ echo "test" | docker run -i -a stdin ubuntu cat -
472
+```
471 473
 
472 474
 This pipes data into a container and prints the container's ID by attaching
473 475
 only to the container's `STDIN`.
474 476
 
475
-    $ docker run -a stderr ubuntu echo test
477
+```bash
478
+$ docker run -a stderr ubuntu echo test
479
+```
476 480
 
477 481
 This isn't going to print anything unless there's an error because we've
478 482
 only attached to the `STDERR` of the container. The container's logs
479 483
 still store what's been written to `STDERR` and `STDOUT`.
480 484
 
481
-    $ cat somefile | docker run -i -a stdin mybuilder dobuild
485
+```bash
486
+$ cat somefile | docker run -i -a stdin mybuilder dobuild
487
+```
482 488
 
483 489
 This is how piping a file into a container could be done for a build.
484 490
 The container's ID will be printed after the build is done and the build
... ...
@@ -488,10 +541,18 @@ retrieve the container's ID once the container has finished running.
488 488
 
489 489
 ### Add host device to container (--device)
490 490
 
491
-    $ docker run --device=/dev/sdc:/dev/xvdc --device=/dev/sdd --device=/dev/zero:/dev/nulo -i -t ubuntu ls -l /dev/{xvdc,sdd,nulo}
492
-    brw-rw---- 1 root disk 8, 2 Feb  9 16:05 /dev/xvdc
493
-    brw-rw---- 1 root disk 8, 3 Feb  9 16:05 /dev/sdd
494
-    crw-rw-rw- 1 root root 1, 5 Feb  9 16:05 /dev/nulo
491
+```bash
492
+{% raw %}
493
+$ docker run --device=/dev/sdc:/dev/xvdc \
494
+             --device=/dev/sdd --device=/dev/zero:/dev/nulo \
495
+             -i -t \
496
+             ubuntu ls -l /dev/{xvdc,sdd,nulo}
497
+
498
+brw-rw---- 1 root disk 8, 2 Feb  9 16:05 /dev/xvdc
499
+brw-rw---- 1 root disk 8, 3 Feb  9 16:05 /dev/sdd
500
+crw-rw-rw- 1 root root 1, 5 Feb  9 16:05 /dev/nulo
501
+{% endraw %}
502
+```
495 503
 
496 504
 It is often necessary to directly expose devices to a container. The `--device`
497 505
 option enables that. For example, a specific block storage device or loop
... ...
@@ -502,24 +563,24 @@ By default, the container will be able to `read`, `write` and `mknod` these devi
502 502
 This can be overridden using a third `:rwm` set of options to each `--device`
503 503
 flag:
504 504
 
505
+```bash
506
+$ docker run --device=/dev/sda:/dev/xvdc --rm -it ubuntu fdisk  /dev/xvdc
505 507
 
506
-    $ docker run --device=/dev/sda:/dev/xvdc --rm -it ubuntu fdisk  /dev/xvdc
507
-
508
-    Command (m for help): q
509
-    $ docker run --device=/dev/sda:/dev/xvdc:r --rm -it ubuntu fdisk  /dev/xvdc
510
-    You will not be able to write the partition table.
508
+Command (m for help): q
509
+$ docker run --device=/dev/sda:/dev/xvdc:r --rm -it ubuntu fdisk  /dev/xvdc
510
+You will not be able to write the partition table.
511 511
 
512
-    Command (m for help): q
512
+Command (m for help): q
513 513
 
514
-    $ docker run --device=/dev/sda:/dev/xvdc:rw --rm -it ubuntu fdisk  /dev/xvdc
514
+$ docker run --device=/dev/sda:/dev/xvdc:rw --rm -it ubuntu fdisk  /dev/xvdc
515 515
 
516
-    Command (m for help): q
516
+Command (m for help): q
517 517
 
518
-    $ docker run --device=/dev/sda:/dev/xvdc:m --rm -it ubuntu fdisk  /dev/xvdc
519
-    fdisk: unable to open /dev/xvdc: Operation not permitted
518
+$ docker run --device=/dev/sda:/dev/xvdc:m --rm -it ubuntu fdisk  /dev/xvdc
519
+fdisk: unable to open /dev/xvdc: Operation not permitted
520
+```
520 521
 
521
-> **Note:**
522
-> `--device` cannot be safely used with ephemeral devices. Block devices
522
+> **Note**: `--device` cannot be safely used with ephemeral devices. Block devices
523 523
 > that may be removed should not be added to untrusted containers with
524 524
 > `--device`.
525 525
 
... ...
@@ -529,54 +590,15 @@ Use Docker's `--restart` to specify a container's *restart policy*. A restart
529 529
 policy controls whether the Docker daemon restarts a container after exit.
530 530
 Docker supports the following restart policies:
531 531
 
532
-<table>
533
-  <thead>
534
-    <tr>
535
-      <th>Policy</th>
536
-      <th>Result</th>
537
-    </tr>
538
-  </thead>
539
-  <tbody>
540
-    <tr>
541
-      <td><strong>no</strong></td>
542
-      <td>
543
-        Do not automatically restart the container when it exits. This is the
544
-        default.
545
-      </td>
546
-    </tr>
547
-    <tr>
548
-      <td>
549
-        <span style="white-space: nowrap">
550
-          <strong>on-failure</strong>[:max-retries]
551
-        </span>
552
-      </td>
553
-      <td>
554
-        Restart only if the container exits with a non-zero exit status.
555
-        Optionally, limit the number of restart retries the Docker
556
-        daemon attempts.
557
-      </td>
558
-    </tr>
559
-    <tr>
560
-      <td><strong>always</strong></td>
561
-      <td>
562
-        Always restart the container regardless of the exit status.
563
-        When you specify always, the Docker daemon will try to restart
564
-        the container indefinitely. The container will also always start
565
-        on daemon startup, regardless of the current state of the container.
566
-      </td>
567
-    </tr>
568
-    <tr>
569
-      <td><strong>unless-stopped</strong></td>
570
-      <td>
571
-        Always restart the container regardless of the exit status, but
572
-        do not start it on daemon startup if the container has been put
573
-        to a stopped state before.
574
-      </td>
575
-    </tr>
576
-  </tbody>
577
-</table>
578
-
579
-    $ docker run --restart=always redis
532
+| Policy            | Result                                  |
533
+|-------------------|-----------------------------------------|
534
+| `no`              | Do not automatically restart the container when it exits. This is the default. |
535
+| `failure`         | Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts. |
536
+| `always`          | Always restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container indefinitely. The container will also always start on daemon startup, regardless of the current state of the container. |
537
+
538
+```bash
539
+$ docker run --restart=always redis
540
+```
580 541
 
581 542
 This will run the `redis` container with a restart policy of **always**
582 543
 so that if the container exits, Docker will restart it.
... ...
@@ -591,14 +613,17 @@ You can add other hosts into a container's `/etc/hosts` file by using one or
591 591
 more `--add-host` flags. This example adds a static address for a host named
592 592
 `docker`:
593 593
 
594
-    $ docker run --add-host=docker:10.180.0.1 --rm -it debian
595
-    root@f38c87f2a42d:/# ping docker
596
-    PING docker (10.180.0.1): 48 data bytes
597
-    56 bytes from 10.180.0.1: icmp_seq=0 ttl=254 time=7.600 ms
598
-    56 bytes from 10.180.0.1: icmp_seq=1 ttl=254 time=30.705 ms
599
-    ^C--- docker ping statistics ---
600
-    2 packets transmitted, 2 packets received, 0% packet loss
601
-    round-trip min/avg/max/stddev = 7.600/19.152/30.705/11.553 ms
594
+```bash
595
+$ docker run --add-host=docker:10.180.0.1 --rm -it debian
596
+
597
+root@f38c87f2a42d:/# ping docker
598
+PING docker (10.180.0.1): 48 data bytes
599
+56 bytes from 10.180.0.1: icmp_seq=0 ttl=254 time=7.600 ms
600
+56 bytes from 10.180.0.1: icmp_seq=1 ttl=254 time=30.705 ms
601
+^C--- docker ping statistics ---
602
+2 packets transmitted, 2 packets received, 0% packet loss
603
+round-trip min/avg/max/stddev = 7.600/19.152/30.705/11.553 ms
604
+```
602 605
 
603 606
 Sometimes you need to connect to the Docker host from within your
604 607
 container. To enable this, pass the Docker host's IP address to
... ...
@@ -609,8 +634,12 @@ The flags you pass to `ip addr show` depend on whether you are
609 609
 using IPv4 or IPv6 networking in your containers. Use the following
610 610
 flags for IPv4 address retrieval for a network device named `eth0`:
611 611
 
612
-    $ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print \$2}' | cut -d / -f 1`
613
-    $ docker run  --add-host=docker:${HOSTIP} --rm -it debian
612
+```bash
613
+{% raw %}
614
+$ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print \$2}' | cut -d / -f 1`
615
+$ docker run  --add-host=docker:${HOSTIP} --rm -it debian
616
+{% endraw %}
617
+```
614 618
 
615 619
 For IPv6 use the `-6` flag instead of the `-4` flag. For other network
616 620
 devices, replace `eth0` with the correct device name (for example `docker0`
... ...
@@ -623,15 +652,19 @@ available in the default container, you can set these using the `--ulimit` flag.
623 623
 `--ulimit` is specified with a soft and hard limit as such:
624 624
 `<type>=<soft limit>[:<hard limit>]`, for example:
625 625
 
626
-    $ docker run --ulimit nofile=1024:1024 --rm debian sh -c "ulimit -n"
627
-    1024
626
+```bash
627
+$ docker run --ulimit nofile=1024:1024 --rm debian sh -c "ulimit -n"
628
+1024
629
+```
628 630
 
629
-> **Note:**
630
-> If you do not provide a `hard limit`, the `soft limit` will be used
631
+> **Note**: If you do not provide a `hard limit`, the `soft limit` will be used
631 632
 > for both values. If no `ulimits` are set, they will be inherited from
632 633
 > the default `ulimits` set on the daemon.  `as` option is disabled now.
633 634
 > In other words, the following script is not supported:
634
-> `$ docker run -it --ulimit as=1024 fedora /bin/bash`
635
+>
636
+> ```bash
637
+> $ docker run -it --ulimit as=1024 fedora /bin/bash`
638
+> ```
635 639
 
636 640
 The values are sent to the appropriate `syscall` as they are set.
637 641
 Docker doesn't perform any byte conversion. Take this into account when setting the values.
... ...
@@ -642,10 +675,15 @@ Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linu
642 642
 maximum number of processes available to a user, not to a container.  For example, start four
643 643
 containers with `daemon` user:
644 644
 
645
-    docker run -d -u daemon --ulimit nproc=3 busybox top
646
-    docker run -d -u daemon --ulimit nproc=3 busybox top
647
-    docker run -d -u daemon --ulimit nproc=3 busybox top
648
-    docker run -d -u daemon --ulimit nproc=3 busybox top
645
+```bash
646
+$ docker run -d -u daemon --ulimit nproc=3 busybox top
647
+
648
+$ docker run -d -u daemon --ulimit nproc=3 busybox top
649
+
650
+$ docker run -d -u daemon --ulimit nproc=3 busybox top
651
+
652
+$ docker run -d -u daemon --ulimit nproc=3 busybox top
653
+```
649 654
 
650 655
 The 4th container fails and reports "[8] System error: resource temporarily unavailable" error.
651 656
 This fails because the caller set `nproc=3` resulting in the first three containers using up
... ...
@@ -710,8 +748,9 @@ The `--sysctl` sets namespaced kernel parameters (sysctls) in the
710 710
 container. For example, to turn on IP forwarding in the containers
711 711
 network namespace, run this command:
712 712
 
713
-    $ docker run --sysctl net.ipv4.ip_forward=1 someimage
714
-
713
+```bash
714
+$ docker run --sysctl net.ipv4.ip_forward=1 someimage
715
+```
715 716
 
716 717
 > **Note**: Not all sysctls are namespaced. Docker does not support changing sysctls
717 718
 > inside of a container that also modify the host system. As the kernel
... ...
@@ -719,14 +758,17 @@ network namespace, run this command:
719 719
 
720 720
 #### Currently supported sysctls
721 721
 
722
-  `IPC Namespace`:
722
+- `IPC Namespace`:
723 723
 
724
+  ```none
724 725
   kernel.msgmax, kernel.msgmnb, kernel.msgmni, kernel.sem, kernel.shmall, kernel.shmmax, kernel.shmmni, kernel.shm_rmid_forced
725 726
   Sysctls beginning with fs.mqueue.*
727
+  ```
726 728
 
727 729
   If you use the `--ipc=host` option these sysctls will not be allowed.
728 730
 
729
-  `Network Namespace`:
730
-      Sysctls beginning with net.*
731
+- `Network Namespace`:
732
+
733
+  Sysctls beginning with net.*
731 734
 
732 735
   If you use the `--network=host` option using these sysctls will not be allowed.
... ...
@@ -25,21 +25,38 @@ Options:
25 25
   -o, --output string   Write to a file, instead of STDOUT
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Produces a tarred repository to the standard output stream.
29 31
 Contains all parent layers, and all tags + versions, or specified `repo:tag`, for
30 32
 each argument provided.
31 33
 
32
-It is used to create a backup that can then be used with `docker load`
34
+## Examples
35
+
36
+### Create a backup that can then be used with `docker load`.
37
+
38
+```bash
39
+$ docker save busybox > busybox.tar
40
+
41
+$ ls -sh busybox.tar
42
+
43
+2.7M busybox.tar
44
+
45
+$ docker save --output busybox.tar busybox
33 46
 
34
-    $ docker save busybox > busybox.tar
35
-    $ ls -sh busybox.tar
36
-    2.7M busybox.tar
37
-    $ docker save --output busybox.tar busybox
38
-    $ ls -sh busybox.tar
39
-    2.7M busybox.tar
40
-    $ docker save -o fedora-all.tar fedora
41
-    $ docker save -o fedora-latest.tar fedora:latest
47
+$ ls -sh busybox.tar
42 48
 
43
-It is even useful to cherry-pick particular tags of an image repository
49
+2.7M busybox.tar
44 50
 
45
-    $ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
51
+$ docker save -o fedora-all.tar fedora
52
+
53
+$ docker save -o fedora-latest.tar fedora:latest
54
+```
55
+
56
+### Cherry-pick particular tags
57
+
58
+You can even cherry-pick particular tags of an image repository.
59
+
60
+```bash
61
+$ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
62
+```
... ...
@@ -30,13 +30,14 @@ Options:
30 30
       --no-trunc       Don't truncate output
31 31
 ```
32 32
 
33
+## Description
34
+
33 35
 Search [Docker Hub](https://hub.docker.com) for images
34 36
 
35 37
 See [*Find Public Images on Docker Hub*](https://docs.docker.com/engine/tutorials/dockerrepos/#searching-for-images) for
36 38
 more details on finding shared images from the command line.
37 39
 
38
-> **Note:**
39
-> Search queries will only return up to 25 results
40
+> **Note**: Search queries return a maximum of 25 results.
40 41
 
41 42
 ## Examples
42 43
 
... ...
@@ -44,52 +45,57 @@ more details on finding shared images from the command line.
44 44
 
45 45
 This example displays images with a name containing 'busybox':
46 46
 
47
-    $ docker search busybox
48
-    NAME                             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
49
-    busybox                          Busybox base image.                             316       [OK]       
50
-    progrium/busybox                                                                 50                   [OK]
51
-    radial/busyboxplus               Full-chain, Internet enabled, busybox made...   8                    [OK]
52
-    odise/busybox-python                                                             2                    [OK]
53
-    azukiapp/busybox                 This image is meant to be used as the base...   2                    [OK]
54
-    ofayau/busybox-jvm               Prepare busybox to install a 32 bits JVM.       1                    [OK]
55
-    shingonoide/archlinux-busybox    Arch Linux, a lightweight and flexible Lin...   1                    [OK]
56
-    odise/busybox-curl                                                               1                    [OK]
57
-    ofayau/busybox-libc32            Busybox with 32 bits (and 64 bits) libs         1                    [OK]
58
-    peelsky/zulu-openjdk-busybox                                                     1                    [OK]
59
-    skomma/busybox-data              Docker image suitable for data volume cont...   1                    [OK]
60
-    elektritter/busybox-teamspeak    Lightweight teamspeak3 container based on...    1                    [OK]
61
-    socketplane/busybox                                                              1                    [OK]
62
-    oveits/docker-nginx-busybox      This is a tiny NginX docker image based on...   0                    [OK]
63
-    ggtools/busybox-ubuntu           Busybox ubuntu version with extra goodies       0                    [OK]
64
-    nikfoundas/busybox-confd         Minimal busybox based distribution of confd     0                    [OK]
65
-    openshift/busybox-http-app                                                       0                    [OK]
66
-    jllopis/busybox                                                                  0                    [OK]
67
-    swyckoff/busybox                                                                 0                    [OK]
68
-    powellquiring/busybox                                                            0                    [OK]
69
-    williamyeh/busybox-sh            Docker image for BusyBox's sh                   0                    [OK]
70
-    simplexsys/busybox-cli-powered   Docker busybox images, with a few often us...   0                    [OK]
71
-    fhisamoto/busybox-java           Busybox java                                    0                    [OK]
72
-    scottabernethy/busybox                                                           0                    [OK]
73
-    marclop/busybox-solr
47
+```none
48
+$ docker search busybox
49
+
50
+NAME                             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
51
+busybox                          Busybox base image.                             316       [OK]       
52
+progrium/busybox                                                                 50                   [OK]
53
+radial/busyboxplus               Full-chain, Internet enabled, busybox made...   8                    [OK]
54
+odise/busybox-python                                                             2                    [OK]
55
+azukiapp/busybox                 This image is meant to be used as the base...   2                    [OK]
56
+ofayau/busybox-jvm               Prepare busybox to install a 32 bits JVM.       1                    [OK]
57
+shingonoide/archlinux-busybox    Arch Linux, a lightweight and flexible Lin...   1                    [OK]
58
+odise/busybox-curl                                                               1                    [OK]
59
+ofayau/busybox-libc32            Busybox with 32 bits (and 64 bits) libs         1                    [OK]
60
+peelsky/zulu-openjdk-busybox                                                     1                    [OK]
61
+skomma/busybox-data              Docker image suitable for data volume cont...   1                    [OK]
62
+elektritter/busybox-teamspeak    Lightweight teamspeak3 container based on...    1                    [OK]
63
+socketplane/busybox                                                              1                    [OK]
64
+oveits/docker-nginx-busybox      This is a tiny NginX docker image based on...   0                    [OK]
65
+ggtools/busybox-ubuntu           Busybox ubuntu version with extra goodies       0                    [OK]
66
+nikfoundas/busybox-confd         Minimal busybox based distribution of confd     0                    [OK]
67
+openshift/busybox-http-app                                                       0                    [OK]
68
+jllopis/busybox                                                                  0                    [OK]
69
+swyckoff/busybox                                                                 0                    [OK]
70
+powellquiring/busybox                                                            0                    [OK]
71
+williamyeh/busybox-sh            Docker image for BusyBox's sh                   0                    [OK]
72
+simplexsys/busybox-cli-powered   Docker busybox images, with a few often us...   0                    [OK]
73
+fhisamoto/busybox-java           Busybox java                                    0                    [OK]
74
+scottabernethy/busybox                                                           0                    [OK]
75
+marclop/busybox-solr
76
+```
74 77
 
75 78
 ### Display non-truncated description (--no-trunc)
76 79
 
77 80
 This example displays images with a name containing 'busybox',
78 81
 at least 3 stars and the description isn't truncated in the output:
79 82
 
80
-    $ docker search --stars=3 --no-trunc busybox
81
-    NAME                 DESCRIPTION                                                                               STARS     OFFICIAL   AUTOMATED
82
-    busybox              Busybox base image.                                                                       325       [OK]       
83
-    progrium/busybox                                                                                               50                   [OK]
84
-    radial/busyboxplus   Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors.   8                    [OK]
83
+```bash
84
+$ docker search --stars=3 --no-trunc busybox
85
+NAME                 DESCRIPTION                                                                               STARS     OFFICIAL   AUTOMATED
86
+busybox              Busybox base image.                                                                       325       [OK]       
87
+progrium/busybox                                                                                               50                   [OK]
88
+radial/busyboxplus   Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors.   8                    [OK]
89
+```
85 90
 
86
-## Limit search results (--limit)
91
+### Limit search results (--limit)
87 92
 
88 93
 The flag `--limit` is the maximum number of results returned by a search. This value could
89 94
 be in the range between 1 and 100. The default value of `--limit` is 25.
90 95
 
91 96
 
92
-## Filtering
97
+### Filtering
93 98
 
94 99
 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
95 100
 than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -101,34 +107,43 @@ The currently supported filters are:
101 101
 * is-official (true|false) - is the image official or not
102 102
 
103 103
 
104
-### stars
104
+#### stars
105 105
 
106 106
 This example displays images with a name containing 'busybox' and at
107 107
 least 3 stars:
108 108
 
109
-    $ docker search --filter stars=3 busybox
110
-    NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
111
-    busybox              Busybox base image.                             325       [OK]       
112
-    progrium/busybox                                                     50                   [OK]
113
-    radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
109
+```bash
110
+$ docker search --filter stars=3 busybox
111
+
112
+NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
113
+busybox              Busybox base image.                             325       [OK]       
114
+progrium/busybox                                                     50                   [OK]
115
+radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
116
+```
114 117
 
115 118
 
116
-### is-automated
119
+#### is-automated
117 120
 
118 121
 This example displays images with a name containing 'busybox'
119 122
 and are automated builds:
120 123
 
121
-    $ docker search --filter is-automated busybox
122
-    NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
123
-    progrium/busybox                                                     50                   [OK]
124
-    radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
124
+```bash
125
+$ docker search --filter is-automated busybox
125 126
 
126
-### is-official
127
+NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
128
+progrium/busybox                                                     50                   [OK]
129
+radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
130
+```
131
+
132
+#### is-official
127 133
 
128 134
 This example displays images with a name containing 'busybox', at least
129 135
 3 stars and are official builds:
130 136
 
131
-    $ docker search --filter "is-official=true" --filter "stars=3" busybox
132
-    NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
133
-    progrium/busybox                                                     50                   [OK]
134
-    radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
137
+```bash
138
+$ docker search --filter "is-official=true" --filter "stars=3" busybox
139
+
140
+NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
141
+progrium/busybox                                                     50                   [OK]
142
+radial/busyboxplus   Full-chain, Internet enabled, busybox made...   8                    [OK]
143
+```
... ...
@@ -25,6 +25,8 @@ Options:
25 25
   -l, --label list    Secret labels (default [])
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Creates a secret using standard input or from a file for the secret content. You must run this
29 31
 command on a manager node.
30 32
 
... ...
@@ -45,9 +47,11 @@ mhv17xfe3gh6xc4rij5orpfds   my_secret               2016-10-27 23:25:43.90918108
45 45
 
46 46
 ```bash
47 47
 $ docker secret create my_secret ./secret.json
48
+
48 49
 mhv17xfe3gh6xc4rij5orpfds
49 50
 
50 51
 $ docker secret ls
52
+
51 53
 ID                          NAME                    CREATED                                   UPDATED                                   SIZE
52 54
 mhv17xfe3gh6xc4rij5orpfds   my_secret               2016-10-27 23:25:43.909181089 +0000 UTC   2016-10-27 23:25:43.909181089 +0000 UTC   1679
53 55
 ```
... ...
@@ -55,10 +59,16 @@ mhv17xfe3gh6xc4rij5orpfds   my_secret               2016-10-27 23:25:43.90918108
55 55
 ### Create a secret with labels
56 56
 
57 57
 ```bash
58
-$ docker secret create --label env=dev --label rev=20161102 my_secret ./secret.json
58
+$ docker secret create --label env=dev \
59
+                       --label rev=20161102 \
60
+                       my_secret ./secret.json
61
+
59 62
 jtn7g6aukl5ky7nr9gvwafoxh
63
+```
60 64
 
65
+```none
61 66
 $ docker secret inspect my_secret
67
+
62 68
 [
63 69
     {
64 70
         "ID": "jtn7g6aukl5ky7nr9gvwafoxh",
... ...
@@ -79,11 +89,10 @@ $ docker secret inspect my_secret
79 79
         "SecretSize": 1679
80 80
     }
81 81
 ]
82
-
83 82
 ```
84 83
 
85 84
 
86
-## Related information
85
+## Related commands
87 86
 
88 87
 * [secret inspect](secret_inspect.md)
89 88
 * [secret ls](secret_ls.md)
... ...
@@ -25,6 +25,7 @@ Options:
25 25
       --help            Print usage
26 26
 ```
27 27
 
28
+## Description
28 29
 
29 30
 Inspects the specified secret. This command has to be run targeting a manager
30 31
 node.
... ...
@@ -37,7 +38,7 @@ describes all the details of the format.
37 37
 
38 38
 ## Examples
39 39
 
40
-### Inspecting a secret by name or ID
40
+### Inspect a secret by name or ID
41 41
 
42 42
 You can inspect a secret, either by its *name*, or *ID*
43 43
 
... ...
@@ -49,8 +50,9 @@ ID                          NAME                    CREATED
49 49
 mhv17xfe3gh6xc4rij5orpfds   secret.json             2016-10-27 23:25:43.909181089 +0000 UTC   2016-10-27 23:25:43.909181089 +0000 UTC
50 50
 ```
51 51
 
52
-```bash
52
+```none
53 53
 $ docker secret inspect secret.json
54
+
54 55
 [
55 56
     {
56 57
         "ID": "mhv17xfe3gh6xc4rij5orpfds",
... ...
@@ -66,19 +68,22 @@ $ docker secret inspect secret.json
66 66
 ]
67 67
 ```
68 68
 
69
-### Formatting secret output
69
+### Formatting
70 70
 
71 71
 You can use the --format option to obtain specific information about a
72 72
 secret. The following example command outputs the creation time of the
73 73
 secret.
74 74
 
75
-```bash{% raw %}
75
+```bash
76
+{% raw %}
76 77
 $ docker secret inspect --format='{{.CreatedAt}}' mhv17xfe3gh6xc4rij5orpfds
78
+
77 79
 2016-10-27 23:25:43.909181089 +0000 UTC
78
-{% endraw %}```
80
+{% endraw %}
81
+```
79 82
 
80 83
 
81
-## Related information
84
+## Related commands
82 85
 
83 86
 * [secret create](secret_create.md)
84 87
 * [secret ls](secret_ls.md)
... ...
@@ -27,16 +27,20 @@ Options:
27 27
   -q, --quiet          Only display IDs
28 28
 ```
29 29
 
30
-Run this command on a manager node to list the secrets in the Swarm.
30
+## Description
31
+
32
+Run this command on a manager node to list the secrets in the swarm.
31 33
 
32 34
 ## Examples
33 35
 
34 36
 ```bash
35 37
 $ docker secret ls
38
+
36 39
 ID                          NAME                    CREATED                                   UPDATED
37 40
 mhv17xfe3gh6xc4rij5orpfds   secret.json             2016-10-27 23:25:43.909181089 +0000 UTC   2016-10-27 23:25:43.909181089 +0000 UTC
38 41
 ```
39
-## Related information
42
+
43
+## Related commands
40 44
 
41 45
 * [secret create](secret_create.md)
42 46
 * [secret inspect](secret_inspect.md)
... ...
@@ -27,9 +27,13 @@ Options:
27 27
       --help   Print usage
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Removes the specified secrets from the swarm. This command has to be run
31 33
 targeting a manager node.
32 34
 
35
+## Examples
36
+
33 37
 This example removes a secret:
34 38
 
35 39
 ```bash
... ...
@@ -41,7 +45,7 @@ sapth4csdo5b6wz2p5uimh5xg
41 41
 > before removing a secret.
42 42
 
43 43
 
44
-## Related information
44
+## Related commands
45 45
 
46 46
 * [secret create](secret_create.md)
47 47
 * [secret inspect](secret_inspect.md)
... ...
@@ -68,6 +68,8 @@ Options:
68 68
   -w, --workdir string                   Working directory inside the container
69 69
 ```
70 70
 
71
+## Description
72
+
71 73
 Creates a service as described by the specified parameters. You must run this
72 74
 command on a manager node.
73 75
 
... ...
@@ -77,12 +79,15 @@ command on a manager node.
77 77
 
78 78
 ```bash
79 79
 $ docker service create --name redis redis:3.0.6
80
+
80 81
 dmu1ept4cxcfe8k8lhtux3ro3
81 82
 
82 83
 $ docker service create --mode global --name redis2 redis:3.0.6
84
+
83 85
 a8q9dasaafudfs8q8w32udass
84 86
 
85 87
 $ docker service ls
88
+
86 89
 ID            NAME    MODE        REPLICAS  IMAGE
87 90
 dmu1ept4cxcf  redis   replicated  1/1       redis:3.0.6
88 91
 a8q9dasaafud  redis2  global      1/1       redis:3.0.6
... ...
@@ -95,6 +100,7 @@ service. The following command creates a `redis` service with `5` replica tasks:
95 95
 
96 96
 ```bash
97 97
 $ docker service create --name redis --replicas=5 redis:3.0.6
98
+
98 99
 4cdgfyky7ozwh3htjfw0d12qv
99 100
 ```
100 101
 
... ...
@@ -108,6 +114,7 @@ number of `RUNNING` tasks is `3`:
108 108
 
109 109
 ```bash
110 110
 $ docker service ls
111
+
111 112
 ID            NAME   MODE        REPLICAS  IMAGE
112 113
 4cdgfyky7ozw  redis  replicated  3/5       redis:3.0.7
113 114
 ```
... ...
@@ -117,11 +124,13 @@ equal to the desired number:
117 117
 
118 118
 ```bash
119 119
 $ docker service ls
120
+
120 121
 ID            NAME   MODE        REPLICAS  IMAGE
121 122
 4cdgfyky7ozw  redis  replicated  5/5       redis:3.0.7
122 123
 ```
123 124
 
124 125
 ### Create a service with secrets
126
+
125 127
 Use the `--secret` flag to give a container access to a
126 128
 [secret](secret_create.md).
127 129
 
... ...
@@ -129,6 +138,7 @@ Create a service specifying a secret:
129 129
 
130 130
 ```bash
131 131
 $ docker service create --name redis --secret secret.json redis:3.0.6
132
+
132 133
 4cdgfyky7ozwh3htjfw0d12qv
133 134
 ```
134 135
 
... ...
@@ -139,6 +149,7 @@ $ docker service create --name redis \
139 139
     --secret source=ssh-key,target=ssh \
140 140
     --secret source=app-key,target=app,uid=1000,gid=1001,mode=0400 \
141 141
     redis:3.0.6
142
+
142 143
 4cdgfyky7ozwh3htjfw0d12qv
143 144
 ```
144 145
 
... ...
@@ -172,12 +183,15 @@ This sets environmental variables for all tasks in a service. For example:
172 172
 $ docker service create --name redis_2 --replicas 5 --env MYVAR=foo redis:3.0.6
173 173
 ```
174 174
 
175
-### Create a docker service with specific hostname (--hostname)
175
+### Create a service with specific hostname (--hostname)
176
+
177
+This option sets the docker service containers hostname to a specific string.
178
+For example:
176 179
 
177
-This option sets the docker service containers hostname to a specific string. For example:
178 180
 ```bash
179 181
 $ docker service create --name redis --hostname myredis redis:3.0.6
180 182
 ```
183
+
181 184
 ### Set metadata on a service (-l, --label)
182 185
 
183 186
 A label is a `key=value` pair that applies metadata to a service. To label a
... ...
@@ -201,7 +215,7 @@ or write from files or directories on other containers or the host operating
201 201
 system. These types are _data volumes_ (often referred to simply as volumes) and
202 202
 _bind-mounts_.
203 203
 
204
-Additionally, Docker also supports tmpfs mounts.
204
+Additionally, Docker supports `tmpfs` mounts.
205 205
 
206 206
 A **bind-mount** makes a file or directory on the host available to the
207 207
 container it is mounted within. A bind-mount may be either read-only or
... ...
@@ -303,19 +317,19 @@ The `--mount` flag supports most options that are supported by the `-v`
303 303
 or `--volume` flag for `docker run`, with some important exceptions:
304 304
 
305 305
 - The `--mount` flag allows you to specify a volume driver and volume driver
306
-    options *per volume*, without creating the volumes in advance. In contrast,
307
-    `docker run` allows you to specify a single volume driver which is shared
308
-    by all volumes, using the `--volume-driver` flag.
306
+  options *per volume*, without creating the volumes in advance. In contrast,
307
+  `docker run` allows you to specify a single volume driver which is shared
308
+  by all volumes, using the `--volume-driver` flag.
309 309
 
310 310
 - The `--mount` flag allows you to specify custom metadata ("labels") for a volume,
311
-    before the volume is created.
311
+  before the volume is created.
312 312
 
313 313
 - When you use `--mount` with `type=bind`, the host-path must refer to an *existing*
314
-    path on the host. The path will not be created for you and the service will fail
315
-    with an error if the path does not exist.
314
+  path on the host. The path will not be created for you and the service will fail
315
+  with an error if the path does not exist.
316 316
 
317 317
 - The `--mount` flag does not allow you to relabel a volume with `Z` or `z` flags,
318
-    which are used for `selinux` labeling.
318
+  which are used for `selinux` labeling.
319 319
 
320 320
 #### Create a service using a named volume
321 321
 
... ...
@@ -532,18 +546,25 @@ In this example, we are going to set the template of the created containers base
532 532
 service's name and the node's ID where it sits.
533 533
 
534 534
 ```bash
535
-$ docker service create --name hosttempl --hostname={% raw %}"{{.Node.ID}}-{{.Service.Name}}"{% endraw %} busybox top
535
+{% raw %}
536
+$ docker service create --name hosttempl \
537
+                        --hostname={% raw %}"{{.Node.ID}}-{{.Service.Name}}"\
538
+                         busybox top
539
+
536 540
 va8ew30grofhjoychbr6iot8c
537 541
 
538 542
 $ docker service ps va8ew30grofhjoychbr6iot8c
543
+
539 544
 ID            NAME         IMAGE                                                                                   NODE          DESIRED STATE  CURRENT STATE               ERROR  PORTS
540 545
 wo41w8hg8qan  hosttempl.1  busybox:latest@sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912  2e7a8a9c4da2  Running        Running about a minute ago
541 546
 
542
-$ docker inspect --format={% raw %}"{{.Config.Hostname}}"{% endraw %} hosttempl.1.wo41w8hg8qanxwjwsg4kxpprj
547
+$ docker inspect --format="{{.Config.Hostname}}" hosttempl.1.wo41w8hg8qanxwjwsg4kxpprj
548
+
543 549
 x3ti0erg11rjpg64m75kej2mz-hosttempl
550
+{% endraw %}
544 551
 ```
545 552
 
546
-## Related information
553
+## Related commands
547 554
 
548 555
 * [service inspect](service_inspect.md)
549 556
 * [service logs](service_logs.md)
... ...
@@ -26,6 +26,7 @@ Options:
26 26
       --pretty          Print the information in a human friendly format.
27 27
 ```
28 28
 
29
+## Description
29 30
 
30 31
 Inspects the specified service. This command has to be run targeting a manager
31 32
 node.
... ...
@@ -38,7 +39,7 @@ describes all the details of the format.
38 38
 
39 39
 ## Examples
40 40
 
41
-### Inspecting a service  by name or ID
41
+### Inspect a service by name or ID
42 42
 
43 43
 You can inspect a service, either by its *name*, or *ID*
44 44
 
... ...
@@ -53,8 +54,9 @@ dmu1ept4cxcf  redis  replicated  3/3       redis:3.0.6
53 53
 Both `docker service inspect redis`, and `docker service inspect dmu1ept4cxcf`
54 54
 produce the same result:
55 55
 
56
-```bash
56
+```none
57 57
 $ docker service inspect redis
58
+
58 59
 [
59 60
     {
60 61
         "ID": "dmu1ept4cxcfe8k8lhtux3ro3",
... ...
@@ -98,6 +100,7 @@ $ docker service inspect redis
98 98
 
99 99
 ```bash
100 100
 $ docker service inspect dmu1ept4cxcf
101
+
101 102
 [
102 103
     {
103 104
         "ID": "dmu1ept4cxcfe8k8lhtux3ro3",
... ...
@@ -109,13 +112,14 @@ $ docker service inspect dmu1ept4cxcf
109 109
 ]
110 110
 ```
111 111
 
112
-### Inspect a service using pretty-print
112
+### Formatting
113 113
 
114 114
 You can print the inspect output in a human-readable format instead of the default
115 115
 JSON output, by using the `--pretty` option:
116 116
 
117 117
 ```bash
118 118
 $ docker service inspect --pretty frontend
119
+
119 120
 ID:		c8wgl7q4ndfd52ni6qftkvnnp
120 121
 Name:		frontend
121 122
 Labels:
... ...
@@ -139,19 +143,22 @@ Ports:
139 139
 You can also use `--format pretty` for the same effect.
140 140
 
141 141
 
142
-### Finding the number of tasks running as part of a service
142
+#### Find the number of tasks running as part of a service
143 143
 
144 144
 The `--format` option can be used to obtain specific information about a
145 145
 service. For example, the following command outputs the number of replicas
146 146
 of the "redis" service.
147 147
 
148
-```bash{% raw %}
148
+```bash
149
+{% raw %}
149 150
 $ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis
151
+
150 152
 10
151
-{% endraw %}```
153
+{% endraw %}
154
+```
152 155
 
153 156
 
154
-## Related information
157
+## Related commands
155 158
 
156 159
 * [service create](service_create.md)
157 160
 * [service logs](service_logs.md)
... ...
@@ -30,9 +30,11 @@ Options:
30 30
   -t, --timestamps     Show timestamps
31 31
 ```
32 32
 
33
+## Description
34
+
33 35
 The `docker service logs` command batch-retrieves logs present at the time of execution.
34 36
 
35
-> **Note**: this command is only functional for services that are started with
37
+> **Note**: This command is only functional for services that are started with
36 38
 > the `json-file` or `journald` logging driver.
37 39
 
38 40
 For more information about selecting and configuring logging drivers, refer to
... ...
@@ -66,7 +68,7 @@ seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
66 66
 fraction of a second no more than nine digits long. You can combine the
67 67
 `--since` option with either or both of the `--follow` or `--tail` options.
68 68
 
69
-## Related information
69
+## Related commands
70 70
 
71 71
 * [service create](service_create.md)
72 72
 * [service inspect](service_inspect.md)
... ...
@@ -29,12 +29,18 @@ Options:
29 29
   -q, --quiet          Only display IDs
30 30
 ```
31 31
 
32
+## Description
33
+
32 34
 This command when run targeting a manager, lists services are running in the
33 35
 swarm.
34 36
 
37
+## Examples
38
+
35 39
 On a manager node:
40
+
36 41
 ```bash
37 42
 $ docker service ls
43
+
38 44
 ID            NAME      MODE        REPLICAS    IMAGE
39 45
 c8wgl7q4ndfd  frontend  replicated  5/5         nginx:alpine
40 46
 dmu1ept4cxcf  redis     replicated  3/3         redis:3.0.6
... ...
@@ -44,7 +50,7 @@ iwe3278osahj  mongo     global      7/7         mongo:3.3
44 44
 The `REPLICAS` column shows both the *actual* and *desired* number of tasks for
45 45
 the service.
46 46
 
47
-## Filtering
47
+### Filtering
48 48
 
49 49
 The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
50 50
 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -55,7 +61,7 @@ The currently supported filters are:
55 55
 * [label](service_ls.md#label)
56 56
 * [name](service_ls.md#name)
57 57
 
58
-#### ID
58
+#### id
59 59
 
60 60
 The `id` filter matches all or part of a service's id.
61 61
 
... ...
@@ -65,7 +71,7 @@ ID            NAME   MODE        REPLICAS  IMAGE
65 65
 0bcjwfh8ychr  redis  replicated  1/1       redis:3.0.6
66 66
 ```
67 67
 
68
-#### Label
68
+#### label
69 69
 
70 70
 The `label` filter matches services based on the presence of a `label` alone or
71 71
 a `label` and a value.
... ...
@@ -91,7 +97,7 @@ ID            NAME      MODE        REPLICAS  IMAGE
91 91
 74nzcxxjv6fq  backend   replicated  3/3       redis:3.0.6
92 92
 ```
93 93
 
94
-#### Name
94
+#### name
95 95
 
96 96
 The `name` filter matches on all or part of a service's name.
97 97
 
... ...
@@ -103,7 +109,42 @@ ID            NAME   MODE        REPLICAS  IMAGE
103 103
 0bcjwfh8ychr  redis  replicated  1/1       redis:3.0.6
104 104
 ```
105 105
 
106
+<<<<<<< HEAD
106 107
 ## Related information
108
+=======
109
+### Formatting
110
+
111
+The formatting options (`--format`) pretty-prints services output
112
+using a Go template.
113
+
114
+Valid placeholders for the Go template are listed below:
115
+
116
+Placeholder | Description
117
+------------|------------------------------------------------------------------------------------------
118
+`.ID`       | Service ID
119
+`.Name`     | Service name
120
+`.Mode`     | Service mode (replicated, global)
121
+`.Replicas` | Service replicas
122
+`.Image`    | Service image
123
+
124
+When using the `--format` option, the `service ls` command will either
125
+output the data exactly as the template declares or, when using the
126
+`table` directive, includes column headers as well.
127
+
128
+The following example uses a template without headers and outputs the
129
+`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
130
+
131
+```bash
132
+{% raw %}
133
+$ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
134
+
135
+0zmvwuiu3vue: replicated 10/10
136
+fm6uf97exkul: global 5/5
137
+{% endraw %}
138
+```
139
+
140
+## Related commands
141
+>>>>>>> 40dbbd3... Merge pull request #30804 from mstanleyjones/cli_fixups
107 142
 
108 143
 * [service create](service_create.md)
109 144
 * [service inspect](service_inspect.md)
... ...
@@ -29,12 +29,14 @@ Options:
29 29
   -q, --quiet           Only display task IDs
30 30
 ```
31 31
 
32
-Lists the tasks that are running as part of the specified service. This command
32
+## Description
33
+
34
+Lists the tasks that are running as part of the specified services. This command
33 35
 has to be run targeting a manager node.
34 36
 
35 37
 ## Examples
36 38
 
37
-### Listing the tasks that are part of a service
39
+### List the tasks that are part of a service
38 40
 
39 41
 The following command shows all the tasks that are part of the `redis` service:
40 42
 
... ...
@@ -93,7 +95,7 @@ bk658fpbex0d57cqcwoe3jthu   redis.2      redis:3.0.6@sha256:6a692a76c2081888b589
93 93
 nvjljf7rmor4htv7l8rwcx7i7   \_ redis.2   redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842  worker2   Shutdown       Rejected 5 minutes ago   "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842"
94 94
 ```
95 95
 
96
-## Filtering
96
+### Filtering
97 97
 
98 98
 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
99 99
 is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
... ...
@@ -108,7 +110,7 @@ The currently supported filters are:
108 108
 * [desired-state](#desired-state)
109 109
 
110 110
 
111
-#### ID
111
+#### id
112 112
 
113 113
 The `id` filter matches on all or a prefix of a task's ID.
114 114
 
... ...
@@ -120,7 +122,7 @@ ID             NAME      IMAGE        NODE      DESIRED STATE  CURRENT STATE
120 120
 8eaxrb2fqpbn   redis.10  redis:3.0.6  manager1  Running        Running 8 seconds
121 121
 ```
122 122
 
123
-#### Name
123
+#### name
124 124
 
125 125
 The `name` filter matches on task names.
126 126
 
... ...
@@ -131,7 +133,7 @@ qihejybwf1x5  redis.1  redis:3.0.6  manager1  Running        Running 8 seconds
131 131
 ```
132 132
 
133 133
 
134
-#### Node
134
+#### node
135 135
 
136 136
 The `node` filter matches on a node name or a node ID.
137 137
 
... ...
@@ -150,7 +152,7 @@ ID            NAME      IMAGE        NODE      DESIRED STATE  CURRENT STATE
150 150
 The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
151 151
 
152 152
 
153
-## Related information
153
+## Related commands
154 154
 
155 155
 * [service create](service_create.md)
156 156
 * [service inspect](service_inspect.md)
... ...
@@ -27,24 +27,29 @@ Options:
27 27
       --help   Print usage
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Removes the specified services from the swarm. This command has to be run
31 33
 targeting a manager node.
32 34
 
33
-For example, to remove the redis service:
35
+## Examples
36
+
37
+Remove the `redis` service:
34 38
 
35 39
 ```bash
36 40
 $ docker service rm redis
41
+
37 42
 redis
43
+
38 44
 $ docker service ls
45
+
39 46
 ID  NAME  MODE  REPLICAS  IMAGE
40 47
 ```
41 48
 
42 49
 > **Warning**: Unlike `docker rm`, this command does not ask for confirmation
43 50
 > before removing a running service.
44 51
 
45
-
46
-
47
-## Related information
52
+## Related commands
48 53
 
49 54
 * [service create](service_create.md)
50 55
 * [service inspect](service_inspect.md)
... ...
@@ -24,9 +24,7 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
-## Examples
28
-
29
-### Scale a service
27
+## Description
30 28
 
31 29
 The scale command enables you to scale one or more replicated services either up
32 30
 or down to the desired number of replicas. This command cannot be applied on
... ...
@@ -34,19 +32,27 @@ 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.
36 36
 
37
-For example, the following command scales the "frontend" service to 50 tasks.
37
+## Examples
38
+
39
+### Scale a single service
40
+
41
+The following command scales the "frontend" service to 50 tasks.
38 42
 
39 43
 ```bash
40 44
 $ docker service scale frontend=50
45
+
41 46
 frontend scaled to 50
42 47
 ```
43 48
 
44 49
 The following command tries to scale a global service to 10 tasks and returns an error.
45 50
 
46
-```
51
+```bash
47 52
 $ docker service create --mode global --name backend backend:latest
53
+
48 54
 b4g08uwuairexjub6ome6usqh
55
+
49 56
 $ docker service scale backend=10
57
+
50 58
 backend: scale can only be used with replicated mode
51 59
 ```
52 60
 
... ...
@@ -76,16 +82,18 @@ backend and frontend services:
76 76
 
77 77
 ```bash
78 78
 $ docker service scale backend=3 frontend=5
79
+
79 80
 backend scaled to 3
80 81
 frontend scaled to 5
81 82
 
82 83
 $ docker service ls
84
+
83 85
 ID            NAME      MODE        REPLICAS  IMAGE
84 86
 3pr5mlvu3fh9  frontend  replicated  5/5       nginx:alpine
85 87
 74nzcxxjv6fq  backend   replicated  3/3       redis:3.0.6
86 88
 ```
87 89
 
88
-## Related information
90
+## Related commands
89 91
 
90 92
 * [service create](service_create.md)
91 93
 * [service inspect](service_inspect.md)
... ...
@@ -80,6 +80,8 @@ Options:
80 80
   -w, --workdir string                   Working directory inside the container
81 81
 ```
82 82
 
83
+## Description
84
+
83 85
 Updates a service as described by the specified parameters. This command has to be run targeting a manager node.
84 86
 The parameters are the same as [`docker service create`](service_create.md). Please look at the description there
85 87
 for further information.
... ...
@@ -111,7 +113,7 @@ that only one task is replaced at a time (this is the default behavior). The
111 111
 `--update-delay 30s` setting introduces a 30 second delay between tasks, so
112 112
 that the rolling restart happens gradually.
113 113
 
114
-### Adding and removing mounts
114
+### Add or remove mounts
115 115
 
116 116
 Use the `--mount-add` or `--mount-rm` options add or remove a service's bind-mounts
117 117
 or volumes.
... ...
@@ -151,7 +153,7 @@ $ docker service update --mount-rm /somewhere myservice
151 151
 myservice
152 152
 ```
153 153
 
154
-### Adding and removing secrets
154
+### Add or remove secrets
155 155
 
156 156
 Use the `--secret-add` or `--secret-rm` options add or remove a service's
157 157
 secrets.
... ...
@@ -170,7 +172,7 @@ $ docker service update \
170 170
 Some flags of `service update` support the use of templating.
171 171
 See [`service create`](./service_create.md#templating) for the reference.
172 172
 
173
-## Related information
173
+## Related commands
174 174
 
175 175
 * [service create](service_create.md)
176 176
 * [service inspect](service_inspect.md)
... ...
@@ -30,15 +30,20 @@ Options:
30 30
       --with-registry-auth    Send registry authentication details to Swarm agents
31 31
 ```
32 32
 
33
+## Description
34
+
33 35
 Create and update a stack from a `compose` or a `dab` file on the swarm. This command
34 36
 has to be run targeting a manager node.
35 37
 
36
-## Compose file
38
+## Examples
39
+
40
+### Compose file
37 41
 
38 42
 The `deploy` command supports compose file version `3.0` and above."
39 43
 
40 44
 ```bash
41 45
 $ docker stack deploy --compose-file docker-compose.yml vossibility
46
+
42 47
 Ignoring unsupported options: links
43 48
 
44 49
 Creating network vossibility_vossibility
... ...
@@ -53,8 +58,9 @@ Creating service vossibility_lookupd
53 53
 
54 54
 You can verify that the services were correctly created
55 55
 
56
-```
56
+```bash
57 57
 $ docker service ls
58
+
58 59
 ID            NAME                               MODE        REPLICAS  IMAGE
59 60
 29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
60 61
 4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
... ...
@@ -64,10 +70,11 @@ ID            NAME                               MODE        REPLICAS  IMAGE
64 64
 axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
65 65
 ```
66 66
 
67
-## DAB file
67
+### DAB file
68 68
 
69 69
 ```bash
70 70
 $ docker stack deploy --bundle-file vossibility-stack.dab vossibility
71
+
71 72
 Loading bundle from vossibility-stack.dab
72 73
 Creating service vossibility_elasticsearch
73 74
 Creating service vossibility_kibana
... ...
@@ -81,6 +88,7 @@ You can verify that the services were correctly created:
81 81
 
82 82
 ```bash
83 83
 $ docker service ls
84
+
84 85
 ID            NAME                               MODE        REPLICAS  IMAGE
85 86
 29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
86 87
 4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
... ...
@@ -90,7 +98,7 @@ ID            NAME                               MODE        REPLICAS  IMAGE
90 90
 axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
91 91
 ```
92 92
 
93
-## Related information
93
+## Related commands
94 94
 
95 95
 * [stack ls](stack_ls.md)
96 96
 * [stack ps](stack_ps.md)
... ...
@@ -27,9 +27,13 @@ Options:
27 27
       --help   Print usage
28 28
 ```
29 29
 
30
+## Descriptino
31
+
30 32
 Lists the stacks.
31 33
 
32
-For example, the following command shows all stacks and some additional information:
34
+## Examples
35
+
36
+The following command shows all stacks and some additional information:
33 37
 
34 38
 ```bash
35 39
 $ docker stack ls
... ...
@@ -39,7 +43,7 @@ vossibility-stack  6
39 39
 myapp              2
40 40
 ```
41 41
 
42
-## Related information
42
+## Related commands
43 43
 
44 44
 * [stack deploy](stack_deploy.md)
45 45
 * [stack ps](stack_ps.md)
... ...
@@ -27,10 +27,18 @@ Options:
27 27
       --no-trunc        Do not truncate output
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Lists the tasks that are running as part of the specified stack. This
31 33
 command has to be run targeting a manager node.
32 34
 
33
-## Filtering
35
+## Examples
36
+
37
+```bash
38
+$ docker stack ps
39
+```
40
+
41
+### Filtering
34 42
 
35 43
 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
36 44
 is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
... ...
@@ -43,7 +51,7 @@ The currently supported filters are:
43 43
 * name
44 44
 * desired-state
45 45
 
46
-## Related information
46
+## Related commands
47 47
 
48 48
 * [stack deploy](stack_deploy.md)
49 49
 * [stack ls](stack_ls.md)
... ...
@@ -27,10 +27,12 @@ Options:
27 27
       --help   Print usage
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Remove the stack from the swarm. This command has to be run targeting
31 33
 a manager node.
32 34
 
33
-## Related information
35
+## Related commands
34 36
 
35 37
 * [stack deploy](stack_deploy.md)
36 38
 * [stack ls](stack_ls.md)
... ...
@@ -27,10 +27,14 @@ Options:
27 27
   -q, --quiet          Only display IDs
28 28
 ```
29 29
 
30
+### Description
31
+
30 32
 Lists the services that are running as part of the specified stack. This
31 33
 command has to be run targeting a manager node.
32 34
 
33
-For example, the following command shows all services in the `myapp` stack:
35
+### Examples
36
+
37
+The following command shows all services in the `myapp` stack:
34 38
 
35 39
 ```bash
36 40
 $ docker stack services myapp
... ...
@@ -40,7 +44,7 @@ ID            NAME            REPLICAS  IMAGE
40 40
 dn7m7nhhfb9y  myapp_db        1/1       mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539
41 41
 ```
42 42
 
43
-## Filtering
43
+### Filtering
44 44
 
45 45
 The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
46 46
 is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
... ...
@@ -62,7 +66,39 @@ The currently supported filters are:
62 62
 * name (`--filter name=myapp_web`)
63 63
 * label (`--filter label=key=value`)
64 64
 
65
-## Related information
65
+### Formatting
66
+
67
+The formatting options (`--format`) pretty-prints services output
68
+using a Go template.
69
+
70
+Valid placeholders for the Go template are listed below:
71
+
72
+Placeholder | Description
73
+------------|------------------------------------------------------------------------------------------
74
+`.ID`       | Service ID
75
+`.Name`     | Service name
76
+`.Mode`     | Service mode (replicated, global)
77
+`.Replicas` | Service replicas
78
+`.Image`    | Service image
79
+
80
+When using the `--format` option, the `stack services` command will either
81
+output the data exactly as the template declares or, when using the
82
+`table` directive, includes column headers as well.
83
+
84
+The following example uses a template without headers and outputs the
85
+`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
86
+
87
+```bash
88
+{% raw %}
89
+$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
90
+
91
+0zmvwuiu3vue: replicated 10/10
92
+fm6uf97exkul: global 5/5
93
+{% endraw %}
94
+```
95
+
96
+
97
+## Related commands
66 98
 
67 99
 * [stack deploy](stack_deploy.md)
68 100
 * [stack ls](stack_ls.md)
... ...
@@ -26,3 +26,9 @@ Options:
26 26
       --help                 Print usage
27 27
   -i, --interactive          Attach container's STDIN
28 28
 ```
29
+
30
+## Examples
31
+
32
+```bash
33
+$ docker start my_container
34
+```
... ...
@@ -27,6 +27,8 @@ Options:
27 27
       --no-stream       Disable streaming stats and only pull the first result
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 The `docker stats` command returns a live data stream for running containers. To limit data to one or more specific containers, specify a list of container names or ids separated by a space. You can specify a stopped container but stopped containers do not return any data.
31 33
 
32 34
 If you want more detailed information about a container's resource usage, use the `/containers/(id)/stats` API endpoint.
... ...
@@ -35,41 +37,49 @@ If you want more detailed information about a container's resource usage, use th
35 35
 
36 36
 Running `docker stats` on all running containers against a Linux daemon.
37 37
 
38
-    $ docker stats
39
-    CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O
40
-    1285939c1fd3        0.07%               796 KiB / 64 MiB        1.21%               788 B / 648 B       3.568 MB / 512 KB
41
-    9c76f7834ae2        0.07%               2.746 MiB / 64 MiB      4.29%               1.266 KB / 648 B    12.4 MB / 0 B
42
-    d1ea048f04e4        0.03%               4.583 MiB / 64 MiB      6.30%               2.854 KB / 648 B    27.7 MB / 0 B
38
+```bash
39
+$ docker stats
40
+CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O
41
+1285939c1fd3        0.07%               796 KiB / 64 MiB        1.21%               788 B / 648 B       3.568 MB / 512 KB
42
+9c76f7834ae2        0.07%               2.746 MiB / 64 MiB      4.29%               1.266 KB / 648 B    12.4 MB / 0 B
43
+d1ea048f04e4        0.03%               4.583 MiB / 64 MiB      6.30%               2.854 KB / 648 B    27.7 MB / 0 B
44
+```
43 45
 
44 46
 Running `docker stats` on multiple containers by name and id against a Linux daemon.
45 47
 
46
-    $ docker stats fervent_panini 5acfcb1b4fd1
47
-    CONTAINER           CPU %               MEM USAGE/LIMIT       MEM %               NET I/O
48
-    5acfcb1b4fd1        0.00%               115.2 MiB/1.045 GiB   11.03%              1.422 kB/648 B
49
-    fervent_panini      0.02%               11.08 MiB/1.045 GiB   1.06%               648 B/648 B
48
+```bash
49
+$ docker stats fervent_panini 5acfcb1b4fd1
50
+CONTAINER           CPU %               MEM USAGE/LIMIT       MEM %               NET I/O
51
+5acfcb1b4fd1        0.00%               115.2 MiB/1.045 GiB   11.03%              1.422 kB/648 B
52
+fervent_panini      0.02%               11.08 MiB/1.045 GiB   1.06%               648 B/648 B
53
+```
50 54
 
51 55
 Running `docker stats` on all running containers against a Windows daemon.
52 56
 
53
-    PS E:\> docker stats
54
-    CONTAINER           CPU %               PRIV WORKING SET    NET I/O             BLOCK I/O
55
-    09d3bb5b1604        6.61%               38.21 MiB           17.1 kB / 7.73 kB   10.7 MB / 3.57 MB
56
-    9db7aa4d986d        9.19%               38.26 MiB           15.2 kB / 7.65 kB   10.6 MB / 3.3 MB
57
-    3f214c61ad1d        0.00%               28.64 MiB           64 kB / 6.84 kB     4.42 MB / 6.93 MB
57
+```powershell
58
+PS E:\> docker stats
59
+CONTAINER           CPU %               PRIV WORKING SET    NET I/O             BLOCK I/O
60
+09d3bb5b1604        6.61%               38.21 MiB           17.1 kB / 7.73 kB   10.7 MB / 3.57 MB
61
+9db7aa4d986d        9.19%               38.26 MiB           15.2 kB / 7.65 kB   10.6 MB / 3.3 MB
62
+3f214c61ad1d        0.00%               28.64 MiB           64 kB / 6.84 kB     4.42 MB / 6.93 MB
63
+```
58 64
 
59 65
 Running `docker stats` on multiple containers by name and id against a Windows daemon.
60 66
 
61
-    PS E:\> docker ps -a
62
-    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
63
-    3f214c61ad1d        nanoserver          "cmd"               2 minutes ago       Up 2 minutes                            big_minsky
64
-    9db7aa4d986d        windowsservercore   "cmd"               2 minutes ago       Up 2 minutes                            mad_wilson
65
-    09d3bb5b1604        windowsservercore   "cmd"               2 minutes ago       Up 2 minutes                            affectionate_easley
66
-
67
-    PS E:\> docker stats 3f214c61ad1d mad_wilson
68
-    CONTAINER           CPU %               PRIV WORKING SET    NET I/O             BLOCK I/O
69
-    3f214c61ad1d        0.00%               46.25 MiB           76.3 kB / 7.92 kB   10.3 MB / 14.7 MB
70
-    mad_wilson          9.59%               40.09 MiB           27.6 kB / 8.81 kB   17 MB / 20.1 MB
67
+```powershell
68
+PS E:\> docker ps -a
69
+CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
70
+3f214c61ad1d        nanoserver          "cmd"               2 minutes ago       Up 2 minutes                            big_minsky
71
+9db7aa4d986d        windowsservercore   "cmd"               2 minutes ago       Up 2 minutes                            mad_wilson
72
+09d3bb5b1604        windowsservercore   "cmd"               2 minutes ago       Up 2 minutes                            affectionate_easley
73
+
74
+PS E:\> docker stats 3f214c61ad1d mad_wilson
75
+CONTAINER           CPU %               PRIV WORKING SET    NET I/O             BLOCK I/O
76
+3f214c61ad1d        0.00%               46.25 MiB           76.3 kB / 7.92 kB   10.3 MB / 14.7 MB
77
+mad_wilson          9.59%               40.09 MiB           27.6 kB / 8.81 kB   17 MB / 20.1 MB
78
+```
71 79
 
72
-## Formatting
80
+### Formatting
73 81
 
74 82
 The formatting option (`--format`) pretty prints container output
75 83
 using a Go template.
... ...
@@ -97,21 +107,25 @@ The following example uses a template without headers and outputs the
97 97
 `Container` and `CPUPerc` entries separated by a colon for all images:
98 98
 
99 99
 ```bash
100
+{% raw %}
100 101
 $ docker stats --format "{{.Container}}: {{.CPUPerc}}"
101 102
 
102 103
 09d3bb5b1604: 6.61%
103 104
 9db7aa4d986d: 9.19%
104 105
 3f214c61ad1d: 0.00%
106
+{% endraw %}
105 107
 ```
106 108
 
107 109
 To list all containers statistics with their name, CPU percentage and memory
108 110
 usage in a table format you can use:
109 111
 
110 112
 ```bash
113
+{% raw %}
111 114
 $ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
112 115
 
113 116
 CONTAINER           CPU %               PRIV WORKING SET
114 117
 1285939c1fd3        0.07%               796 KiB / 64 MiB
115 118
 9c76f7834ae2        0.07%               2.746 MiB / 64 MiB
116 119
 d1ea048f04e4        0.03%               4.583 MiB / 64 MiB
120
+{% endraw %}
117 121
 ```
... ...
@@ -25,5 +25,13 @@ Options:
25 25
   -t, --time int   Seconds to wait for stop before killing it (default 10)
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 The main process inside the container will receive `SIGTERM`, and after a grace
29 31
 period, `SIGKILL`.
32
+
33
+## Examples
34
+
35
+```bash
36
+$ docker stop my_container
37
+```
... ...
@@ -34,9 +34,12 @@ Options:
34 34
       --task-history-limit int          Task history retention limit (default 5)
35 35
 ```
36 36
 
37
+## Description
38
+
37 39
 Initialize a swarm. The docker engine targeted by this command becomes a manager
38 40
 in the newly created single-node swarm.
39 41
 
42
+## Examples
40 43
 
41 44
 ```bash
42 45
 $ docker swarm init --advertise-addr 192.168.99.121
... ...
@@ -133,7 +136,17 @@ Snapshots compact the Raft log and allow for more efficient transfer of the
133 133
 state to new managers. However, there is a performance cost to taking snapshots
134 134
 frequently.
135 135
 
136
-## Related information
136
+### `--availability`
137
+
138
+This flag specifies the availability of the node at the time the node joins a master.
139
+Possible availability values are `active`, `pause`, or `drain`.
140
+
141
+This flag is useful in certain situations. For example, a cluster may want to have
142
+dedicated manager nodes that are not served as worker nodes. This could be achieved
143
+by passing `--availability=drain` to `docker swarm init`.
144
+
145
+
146
+## Related commands
137 147
 
138 148
 * [swarm join](swarm_join.md)
139 149
 * [swarm leave](swarm_leave.md)
... ...
@@ -27,10 +27,14 @@ Options:
27 27
       --token string            Token for entry into the swarm
28 28
 ```
29 29
 
30
+## Description
31
+
30 32
 Join a node to a swarm. The node joins as a manager node or worker node based upon the token you
31 33
 pass with the `--token` flag. If you pass a manager token, the node joins as a manager. If you
32 34
 pass a worker token, the node joins as a worker.
33 35
 
36
+## Examples
37
+
34 38
 ### Join a node to swarm as a manager
35 39
 
36 40
 The example below demonstrates joining a manager node using a manager token.
... ...
@@ -95,7 +99,7 @@ This flag is generally not necessary when joining an existing swarm.
95 95
 Secret value required for nodes to join the swarm
96 96
 
97 97
 
98
-## Related information
98
+## Related commands
99 99
 
100 100
 * [swarm init](swarm_init.md)
101 101
 * [swarm leave](swarm_leave.md)
... ...
@@ -26,12 +26,16 @@ Options:
26 26
       --rotate   Rotate join token
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 Join tokens are secrets that allow a node to join the swarm. There are two
30 32
 different join tokens available, one for the worker role and one for the manager
31 33
 role. You pass the token using the `--token` flag when you run
32 34
 [swarm join](swarm_join.md). Nodes use the join token only when they join the
33 35
 swarm.
34 36
 
37
+## Examples
38
+
35 39
 You can view or rotate the join tokens using `swarm join-token`.
36 40
 
37 41
 As a convenience, you can pass `worker` or `manager` as an argument to
... ...
@@ -100,6 +104,6 @@ because the join token is only used for authorizing new nodes joining the swarm.
100 100
 
101 101
 Only print the token. Do not print a complete command for joining.
102 102
 
103
-## Related information
103
+## Related commands
104 104
 
105 105
 * [swarm join](swarm_join.md)
... ...
@@ -25,6 +25,8 @@ Options:
25 25
       --help    Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 When you run this command on a worker, that worker leaves the swarm.
29 31
 
30 32
 You can use the `--force` option on a manager to remove it from the swarm.
... ...
@@ -34,7 +36,10 @@ from a swarm is to demote it to a worker and then direct it to leave the quorum
34 34
 without using `--force`. Only use `--force` in situations where the swarm will
35 35
 no longer be used after the manager leaves, such as in a single-node swarm.
36 36
 
37
+## Examples
38
+
37 39
 Consider the following swarm, as seen from the manager:
40
+
38 41
 ```bash
39 42
 $ docker node ls
40 43
 ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS
... ...
@@ -44,13 +49,18 @@ dvfxp4zseq4s0rih1selh0d20 *  manager1  Ready   Active        Leader
44 44
 ```
45 45
 
46 46
 To remove `worker2`, issue the following command from `worker2` itself:
47
+
47 48
 ```bash
48 49
 $ docker swarm leave
49 50
 Node left the default swarm.
50 51
 ```
51
-To remove an inactive node, use the [`node rm`](node_rm.md) command instead.
52 52
 
53
-## Related information
53
+The node will still appear in the node list, and marked as `down`. It no longer
54
+affects swarm operation, but a long list of `down` nodes can clutter the node
55
+list. To remove an inactive node from the list, use the [`node rm`](node_rm.md)
56
+command.
57
+
58
+## Related commands
54 59
 
55 60
 * [node rm](node_rm.md)
56 61
 * [swarm init](swarm_init.md)
... ...
@@ -24,18 +24,21 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
+## Description
28
+
27 29
 Unlocks a locked manager using a user-supplied unlock key. This command must be
28 30
 used to reactivate a manager after its Docker daemon restarts if the autolock
29 31
 setting is turned on. The unlock key is printed at the time when autolock is
30 32
 enabled, and is also available from the `docker swarm unlock-key` command.
31 33
 
34
+## Examples
32 35
 
33 36
 ```bash
34 37
 $ docker swarm unlock
35 38
 Please enter unlock key:
36 39
 ```
37 40
 
38
-## Related information
41
+## Related commands
39 42
 
40 43
 * [swarm init](swarm_init.md)
41 44
 * [swarm update](swarm_update.md)
... ...
@@ -26,6 +26,8 @@ Options:
26 26
       --rotate   Rotate unlock key
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 An unlock key is a secret key needed to unlock a manager after its Docker daemon
30 32
 restarts. These keys are only used when the autolock feature is enabled for the
31 33
 swarm.
... ...
@@ -33,9 +35,11 @@ swarm.
33 33
 You can view or rotate the unlock key using `swarm unlock-key`. To view the key,
34 34
 run the `docker swarm unlock-key` command without any arguments:
35 35
 
36
+## Examples
36 37
 
37 38
 ```bash
38 39
 $ docker swarm unlock-key
40
+
39 41
 To unlock a swarm manager after it restarts, run the `docker swarm unlock`
40 42
 command and provide the following key:
41 43
 
... ...
@@ -77,7 +81,7 @@ key. The old unlock key will no longer be accepted.
77 77
 
78 78
 Only print the unlock key, without instructions.
79 79
 
80
-## Related information
80
+## Related commands
81 81
 
82 82
 * [swarm unlock](swarm_unlock.md)
83 83
 * [swarm init](swarm_init.md)
... ...
@@ -31,14 +31,17 @@ Options:
31 31
       --task-history-limit int          Task history retention limit (default 5)
32 32
 ```
33 33
 
34
+## Description
35
+
34 36
 Updates a swarm with new parameter values. This command must target a manager node.
35 37
 
38
+## Examples
36 39
 
37 40
 ```bash
38 41
 $ docker swarm update --cert-expiry 720h
39 42
 ```
40 43
 
41
-## Related information
44
+## Related commands
42 45
 
43 46
 * [swarm init](swarm_init.md)
44 47
 * [swarm join](swarm_join.md)
... ...
@@ -25,12 +25,18 @@ Options:
25 25
   -v, --verbose   Show detailed information on space usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 The `docker system df` command displays information regarding the
29 31
 amount of disk space used by the docker daemon.
30 32
 
33
+## Examples
34
+
31 35
 By default the command will just show a summary of the data used:
36
+
32 37
 ```bash
33 38
 $ docker system df
39
+
34 40
 TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
35 41
 Images              5                   2                   16.43 MB            11.63 MB (70%)
36 42
 Containers          2                   0                   212 B               212 B (100%)
... ...
@@ -38,8 +44,10 @@ Local Volumes       2                   1                   36 B
38 38
 ```
39 39
 
40 40
 A more detailed view can be requested using the `-v, --verbose` flag:
41
+
41 42
 ```bash
42 43
 $ docker system df -v
44
+
43 45
 Images space usage:
44 46
 
45 47
 REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE                SHARED SIZE         UNIQUE SIZE         CONTAINERS
... ...
@@ -66,9 +74,10 @@ my-named-vol                                                       0
66 66
 * `UNIQUE SIZE` is the amount of space that is only used by a given image
67 67
 * `SIZE` is the virtual size of the image, it is the sum of `SHARED SIZE` and `UNIQUE SIZE`
68 68
 
69
-Note that network information is not shown because it doesn't consume the disk space.
69
+> **Note**: Network information is not shown because it doesn't consume the disk
70
+> space.
70 71
 
71
-## Related Information
72
+## Related commands
72 73
 * [system prune](system_prune.md)
73 74
 * [container prune](container_prune.md)
74 75
 * [volume prune](volume_prune.md)
... ...
@@ -26,12 +26,15 @@ Options:
26 26
       --help    Print usage
27 27
 ```
28 28
 
29
+## Description
30
+
29 31
 Remove all unused containers, volumes, networks and images (both dangling and unreferenced).
30 32
 
31
-Example output:
33
+## Examples
32 34
 
33 35
 ```bash
34 36
 $ docker system prune -a
37
+
35 38
 WARNING! This will remove:
36 39
 	- all stopped containers
37 40
 	- all volumes not used by at least one container
... ...
@@ -64,7 +67,28 @@ deleted: sha256:3a88a5c81eb5c283e72db2dbc6d65cbfd8e80b6c89bb6e714cfaaa0eed99c548
64 64
 Total reclaimed space: 13.5 MB
65 65
 ```
66 66
 
67
-## Related information
67
+### Filtering
68
+
69
+The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
70
+than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
71
+
72
+The currently supported filters are:
73
+
74
+* until (`<timestamp>`) - only remove containers, images, and networks created before given timestamp
75
+
76
+The `until` filter can be Unix timestamps, date formatted
77
+timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
78
+relative to the daemon machine’s time. Supported formats for date
79
+formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
80
+`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
81
+timezone on the daemon will be used if you do not provide either a `Z` or a
82
+`+-00:00` timezone offset at the end of the timestamp.  When providing Unix
83
+timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
84
+that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
85
+seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
86
+fraction of a second no more than nine digits long.
87
+
88
+## Related commands
68 89
 
69 90
 * [volume create](volume_create.md)
70 91
 * [volume ls](volume_ls.md)
... ...
@@ -24,6 +24,8 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
+## Description
28
+
27 29
 An image name is made up of slash-separated name components, optionally prefixed
28 30
 by a registry hostname. The hostname must comply with standard DNS rules, but
29 31
 may not contain underscores. If a hostname is present, it may optionally be
... ...
@@ -40,35 +42,43 @@ period or a dash and may contain a maximum of 128 characters.
40 40
 You can group your images together using names and tags, and then upload them
41 41
 to [*Share Images via Repositories*](https://docs.docker.com/engine/tutorials/dockerrepos/#/contributing-to-docker-hub).
42 42
 
43
-# Examples
43
+## Examples
44 44
 
45
-## Tagging an image referenced by ID
45
+### Tag an image referenced by ID
46 46
 
47 47
 To tag a local image with ID "0e5574283393" into the "fedora" repository with
48 48
 "version1.0":
49 49
 
50
-    docker tag 0e5574283393 fedora/httpd:version1.0
50
+```bash
51
+$ docker tag 0e5574283393 fedora/httpd:version1.0
52
+```
51 53
 
52
-## Tagging an image referenced by Name
54
+### Tag an image referenced by Name
53 55
 
54 56
 To tag a local image with name "httpd" into the "fedora" repository with
55 57
 "version1.0":
56 58
 
57
-    docker tag httpd fedora/httpd:version1.0
59
+```bash
60
+$ docker tag httpd fedora/httpd:version1.0
61
+```
58 62
 
59 63
 Note that since the tag name is not specified, the alias is created for an
60 64
 existing local version `httpd:latest`.
61 65
 
62
-## Tagging an image referenced by Name and Tag
66
+### Tag an image referenced by Name and Tag
63 67
 
64 68
 To tag a local image with name "httpd" and tag "test" into the "fedora"
65 69
 repository with "version1.0.test":
66 70
 
67
-    docker tag httpd:test fedora/httpd:version1.0.test
71
+```bash
72
+$ docker tag httpd:test fedora/httpd:version1.0.test
73
+```
68 74
 
69
-## Tagging an image for a private repository
75
+### Tag an image for a private repository
70 76
 
71 77
 To push an image to a private registry and not the central Docker
72 78
 registry you must tag it with the registry hostname and port (if needed).
73 79
 
74
-    docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0
80
+```bash
81
+$ docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0
82
+```
... ...
@@ -24,6 +24,8 @@ Options:
24 24
       --help   Print usage
25 25
 ```
26 26
 
27
+## Description
28
+
27 29
 The `docker unpause` command un-suspends all processes in the specified containers.
28 30
 On Linux, it does this using the cgroups freezer.
29 31
 
... ...
@@ -31,6 +33,12 @@ See the
31 31
 [cgroups freezer documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt)
32 32
 for further details.
33 33
 
34
-## Related information
34
+## Examples
35
+
36
+```bash
37
+$ docker unpause my_container
38
+```
39
+
40
+## Related commands
35 41
 
36 42
 * [pause](pause.md)
... ...
@@ -37,6 +37,8 @@ Options:
37 37
       --restart string              Restart policy to apply when a container exits
38 38
 ```
39 39
 
40
+## Description
41
+
40 42
 The `docker update` command dynamically updates container configuration.
41 43
 You can use this command to prevent containers from consuming too many
42 44
 resources from their Docker host.  With a single command, you can place
... ...
@@ -25,6 +25,8 @@ Options:
25 25
       --help            Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 By default, this will render all version information in an easy to read
29 31
 layout. If a format is specified, the given template will be executed instead.
30 32
 
... ...
@@ -33,35 +35,44 @@ describes all the details of the format.
33 33
 
34 34
 ## Examples
35 35
 
36
-**Default output:**
37
-
38
-    $ docker version
39
-	Client:
40
-	 Version:      1.8.0
41
-	 API version:  1.20
42
-	 Go version:   go1.4.2
43
-	 Git commit:   f5bae0a
44
-	 Built:        Tue Jun 23 17:56:00 UTC 2015
45
-	 OS/Arch:      linux/amd64
46
-
47
-	Server:
48
-	 Version:      1.8.0
49
-	 API version:  1.20
50
-	 Go version:   go1.4.2
51
-	 Git commit:   f5bae0a
52
-	 Built:        Tue Jun 23 17:56:00 UTC 2015
53
-	 OS/Arch:      linux/amd64
54
-
55
-**Get server version:**
56
-
57
-    {% raw %}
58
-    $ docker version --format '{{.Server.Version}}'
59
-	1.8.0
60
-    {% endraw %}
61
-
62
-**Dump raw data:**
63
-
64
-    {% raw %}
65
-    $ docker version --format '{{json .}}'
66
-    {"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"},"ServerOK":true,"Server":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","KernelVersion":"3.13.2-gentoo","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"}}
67
-    {% endraw %}
36
+### Default output
37
+
38
+```bash
39
+$ docker version
40
+
41
+Client:
42
+Version:      1.8.0
43
+API version:  1.20
44
+Go version:   go1.4.2
45
+Git commit:   f5bae0a
46
+Built:        Tue Jun 23 17:56:00 UTC 2015
47
+OS/Arch:      linux/amd64
48
+
49
+Server:
50
+Version:      1.8.0
51
+API version:  1.20
52
+Go version:   go1.4.2
53
+Git commit:   f5bae0a
54
+Built:        Tue Jun 23 17:56:00 UTC 2015
55
+OS/Arch:      linux/amd64
56
+```
57
+
58
+### Get the server version
59
+
60
+```bash
61
+{% raw %}
62
+$ docker version --format '{{.Server.Version}}'
63
+
64
+1.8.0
65
+{% endraw %}
66
+```
67
+
68
+### Dump raw JSON data
69
+
70
+```bash
71
+{% raw %}
72
+$ docker version --format '{{json .}}'
73
+
74
+{"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"},"ServerOK":true,"Server":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","KernelVersion":"3.13.2-gentoo","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"}}
75
+{% endraw %}
76
+```
... ...
@@ -27,33 +27,51 @@ Options:
27 27
   -o, --opt value       Set driver specific options (default map[])
28 28
 ```
29 29
 
30
-Creates a new volume that containers can consume and store data in. If a name is not specified, Docker generates a random name. You create a volume and then configure the container to use it, for example:
30
+## Description
31
+
32
+Creates a new volume that containers can consume and store data in. If a name is
33
+not specified, Docker generates a random name.
34
+
35
+## Examples
36
+
37
+Create a volume and then configure the container to use it:
31 38
 
32 39
 ```bash
33 40
 $ docker volume create hello
41
+
34 42
 hello
35 43
 
36 44
 $ docker run -d -v hello:/world busybox ls /world
37 45
 ```
38 46
 
39
-The mount is created inside the container's `/world` directory. Docker does not support relative paths for mount points inside the container.
47
+The mount is created inside the container's `/world` directory. Docker does not
48
+support relative paths for mount points inside the container.
40 49
 
41
-Multiple containers can use the same volume in the same time period. This is useful if two containers need access to shared data. For example, if one container writes and the other reads the data.
50
+Multiple containers can use the same volume in the same time period. This is
51
+useful if two containers need access to shared data. For example, if one
52
+container writes and the other reads the data.
42 53
 
43
-Volume names must be unique among drivers.  This means you cannot use the same volume name with two different drivers.  If you attempt this `docker` returns an error:
54
+Volume names must be unique among drivers. This means you cannot use the same
55
+volume name with two different drivers. If you attempt this `docker` returns an
56
+error:
44 57
 
45
-```
58
+```none
46 59
 A volume named  "hello"  already exists with the "some-other" driver. Choose a different volume name.
47 60
 ```
48 61
 
49
-If you specify a volume name already in use on the current driver, Docker assumes you want to re-use the existing volume and does not return an error.   
62
+If you specify a volume name already in use on the current driver, Docker
63
+assumes you want to re-use the existing volume and does not return an error.
50 64
 
51
-## Driver specific options
65
+### Driver-specific options
52 66
 
53
-Some volume drivers may take options to customize the volume creation. Use the `-o` or `--opt` flags to pass driver options:
67
+Some volume drivers may take options to customize the volume creation. Use the
68
+`-o` or `--opt` flags to pass driver options:
54 69
 
55 70
 ```bash
56
-$ docker volume create --driver fake --opt tardis=blue --opt timey=wimey
71
+$ docker volume create --driver fake \
72
+    --opt tardis=blue \
73
+    --opt timey=wimey \
74
+    foo
57 75
 ```
58 76
 
59 77
 These options are passed directly to the volume driver. Options for
... ...
@@ -61,28 +79,44 @@ different volume drivers may do different things (or nothing at all).
61 61
 
62 62
 The built-in `local` driver on Windows does not support any options.
63 63
 
64
-The built-in `local` driver on Linux accepts options similar to the linux `mount` command. You can provide multiple options by passing the `--opt` flag multiple times. Some `mount` options (such as the `o` option) can take a comma-separated list of options. Complete list of available mount options can be found [here](http://man7.org/linux/man-pages/man8/mount.8.html).
64
+The built-in `local` driver on Linux accepts options similar to the linux
65
+`mount` command. You can provide multiple options by passing the `--opt` flag
66
+multiple times. Some `mount` options (such as the `o` option) can take a
67
+comma-separated list of options. Complete list of available mount options can be
68
+found [here](http://man7.org/linux/man-pages/man8/mount.8.html).
65 69
 
66
-For example, the following creates a `tmpfs` volume called `foo` with a size of 100 megabyte and `uid` of 1000.
70
+For example, the following creates a `tmpfs` volume called `foo` with a size of
71
+100 megabyte and `uid` of 1000.
67 72
 
68 73
 ```bash
69
-$ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 foo
74
+$ docker volume create --driver local \
75
+    --opt type=tmpfs \
76
+    --opt device=tmpfs \
77
+    --opt o=size=100m,uid=1000 \
78
+    foo
70 79
 ```
71 80
 
72 81
 Another example that uses `btrfs`:
73 82
 
74 83
 ```bash
75
-$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 foo
84
+$ docker volume create --driver local \
85
+    --opt type=btrfs \
86
+    --opt device=/dev/sda2 \
87
+    foo
76 88
 ```
77 89
 
78
-Another example that uses `nfs` to mount the `/path/to/dir` in `rw` mode from `192.168.1.1`:
90
+Another example that uses `nfs` to mount the `/path/to/dir` in `rw` mode from
91
+`192.168.1.1`:
79 92
 
80 93
 ```bash
81
-$ docker volume create --driver local --opt type=nfs --opt o=addr=192.168.1.1,rw --opt device=:/path/to/dir foo
94
+$ docker volume create --driver local \
95
+    --opt type=nfs \
96
+    --opt o=addr=192.168.1.1,rw \
97
+    --opt device=:/path/to/dir \
98
+    foo
82 99
 ```
83 100
 
84
-
85
-## Related information
101
+## Related commands
86 102
 
87 103
 * [volume inspect](volume_inspect.md)
88 104
 * [volume ls](volume_ls.md)
... ...
@@ -25,32 +25,36 @@ Options:
25 25
       --help            Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Returns information about a volume. By default, this command renders all results
29 31
 in a JSON array. You can specify an alternate format to execute a
30 32
 given template for each result. Go's
31 33
 [text/template](http://golang.org/pkg/text/template/) package describes all the
32 34
 details of the format.
33 35
 
34
-Example output:
35
-
36
-    $ docker volume create
37
-    85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
38
-    $ docker volume inspect 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
39
-    [
40
-      {
41
-          "Name": "85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d",
42
-          "Driver": "local",
43
-          "Mountpoint": "/var/lib/docker/volumes/85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d/_data",
44
-          "Status": null
45
-      }
46
-    ]
47
-
48
-    {% raw %}
49
-    $ docker volume inspect --format '{{ .Mountpoint }}' 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
50
-    /var/lib/docker/volumes/85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d/_data
51
-    {% endraw %}
52
-
53
-## Related information
36
+## Examples
37
+
38
+```bash
39
+$ docker volume create
40
+85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
41
+$ docker volume inspect 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
42
+[
43
+  {
44
+      "Name": "85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d",
45
+      "Driver": "local",
46
+      "Mountpoint": "/var/lib/docker/volumes/85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d/_data",
47
+      "Status": null
48
+  }
49
+]
50
+
51
+{% raw %}
52
+$ docker volume inspect --format '{{ .Mountpoint }}' 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
53
+/var/lib/docker/volumes/85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d/_data
54
+{% endraw %}
55
+```
56
+
57
+## Related commands
54 58
 
55 59
 * [volume create](volume_create.md)
56 60
 * [volume ls](volume_ls.md)
... ...
@@ -34,22 +34,32 @@ Options:
34 34
   -q, --quiet          Only display volume names
35 35
 ```
36 36
 
37
-List all the volumes 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.
37
+## Description
38 38
 
39
-Example output:
39
+List all the volumes known to Docker. You can filter using the `-f` or
40
+`--filter` flag. Refer to the [filtering](#filtering) section for more
41
+information about available filter options.
40 42
 
43
+## Examples
44
+
45
+### Create a volume
41 46
 ```bash
42 47
 $ docker volume create rosemary
48
+
43 49
 rosemary
44
-$docker volume create tyler
50
+
51
+$ docker volume create tyler
52
+
45 53
 tyler
54
+
46 55
 $ docker volume ls
56
+
47 57
 DRIVER              VOLUME NAME
48 58
 local               rosemary
49 59
 local               tyler
50 60
 ```
51 61
 
52
-## Filtering
62
+### Filtering
53 63
 
54 64
 The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
55 65
 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
... ...
@@ -61,7 +71,7 @@ The currently supported filters are:
61 61
 * label (`label=<key>` or `label=<key>=<value>`)
62 62
 * name (a volume's name)
63 63
 
64
-### dangling
64
+#### dangling
65 65
 
66 66
 The `dangling` filter matches on all volumes not referenced by any containers
67 67
 
... ...
@@ -74,7 +84,7 @@ DRIVER              VOLUME NAME
74 74
 local               rosemary
75 75
 ```
76 76
 
77
-### driver
77
+#### driver
78 78
 
79 79
 The `driver` filter matches on all or part of a volume's driver name.
80 80
 
... ...
@@ -88,7 +98,7 @@ local               rosemary
88 88
 local               tyler
89 89
 ```
90 90
 
91
-#### Label
91
+#### label
92 92
 
93 93
 The `label` filter matches volumes based on the presence of a `label` alone or
94 94
 a `label` and a value.
... ...
@@ -97,8 +107,10 @@ First, let's create some volumes to illustrate this;
97 97
 
98 98
 ```bash
99 99
 $ docker volume create the-doctor --label is-timelord=yes
100
+
100 101
 the-doctor
101 102
 $ docker volume create daleks --label is-timelord=no
103
+
102 104
 daleks
103 105
 ```
104 106
 
... ...
@@ -113,7 +125,7 @@ local               daleks
113 113
 local               the-doctor
114 114
 ```
115 115
 
116
-As can be seen in the above example, both volumes with `is-timelord=yes`, and
116
+As the above example demonstrates, both volumes with `is-timelord=yes`, and
117 117
 `is-timelord=no` are returned.
118 118
 
119 119
 Filtering on both `key` *and* `value` of the label, produces the expected result:
... ...
@@ -134,17 +146,20 @@ $ docker volume ls --filter label=is-timelord=yes --filter label=is-timelord=no
134 134
 DRIVER              VOLUME NAME
135 135
 ```
136 136
 
137
-### name
137
+#### name
138 138
 
139 139
 The `name` filter matches on all or part of a volume's name.
140 140
 
141 141
 The following filter matches all volumes with a name containing the `rose` string.
142 142
 
143
-    $ docker volume ls -f name=rose
144
-    DRIVER              VOLUME NAME
145
-    local               rosemary
143
+```bash
144
+$ docker volume ls -f name=rose
146 145
 
147
-## Formatting
146
+DRIVER              VOLUME NAME
147
+local               rosemary
148
+```
149
+
150
+### Formatting
148 151
 
149 152
 The formatting options (`--format`) pretty-prints volumes output
150 153
 using a Go template.
... ...
@@ -168,13 +183,16 @@ The following example uses a template without headers and outputs the
168 168
 `Name` and `Driver` entries separated by a colon for all volumes:
169 169
 
170 170
 ```bash
171
+{% raw %}
171 172
 $ docker volume ls --format "{{.Name}}: {{.Driver}}"
173
+
172 174
 vol1: local
173 175
 vol2: local
174 176
 vol3: local
177
+{% endraw %}
175 178
 ```
176 179
 
177
-## Related information
180
+## Related commands
178 181
 
179 182
 * [volume create](volume_create.md)
180 183
 * [volume inspect](volume_inspect.md)
... ...
@@ -25,12 +25,15 @@ Options:
25 25
       --help    Print usage
26 26
 ```
27 27
 
28
+## Description
29
+
28 30
 Remove all unused volumes. Unused volumes are those which are not referenced by any containers
29 31
 
30
-Example output:
32
+## Examples
31 33
 
32 34
 ```bash
33 35
 $ docker volume prune
36
+
34 37
 WARNING! This will remove all volumes not used by at least one container.
35 38
 Are you sure you want to continue? [y/N] y
36 39
 Deleted Volumes:
... ...
@@ -40,7 +43,7 @@ my-named-vol
40 40
 Total reclaimed space: 36 B
41 41
 ```
42 42
 
43
-## Related information
43
+## Related commands
44 44
 
45 45
 * [volume create](volume_create.md)
46 46
 * [volume ls](volume_ls.md)
... ...
@@ -28,12 +28,18 @@ Options:
28 28
       --help   Print usage
29 29
 ```
30 30
 
31
+## Description
32
+
31 33
 Remove one or more volumes. You cannot remove a volume that is in use by a container.
32 34
 
33
-    $ docker volume rm hello
34
-    hello
35
+## Examples
36
+
37
+```bash
38
+  $ docker volume rm hello
39
+  hello
40
+```
35 41
 
36
-## Related information
42
+## Related commands
37 43
 
38 44
 * [volume create](volume_create.md)
39 45
 * [volume inspect](volume_inspect.md)
... ...
@@ -23,3 +23,36 @@ Block until one or more containers stop, then print their exit codes
23 23
 Options:
24 24
       --help   Print usage
25 25
 ```
26
+
27
+> **Note**: `docker wait` returns `0` when run against a container which had
28
+> already exited before the `docker wait` command was run.
29
+
30
+## Examples
31
+
32
+Start a container in the background.
33
+
34
+```bash
35
+$ docker run -dit --name=my_container ubuntu bash
36
+```
37
+
38
+Run `docker wait`, which should block until the container exits.
39
+
40
+```bash
41
+$ docker wait my_container
42
+```
43
+
44
+In another terminal, stop the first container. The `docker wait` command above
45
+returns the exit code.
46
+
47
+```bash
48
+$ docker stop my_container
49
+```
50
+
51
+This is the same `docker wait` command from above, but it now exits, returning
52
+`0`.
53
+
54
+```bash
55
+$ docker wait my_container
56
+
57
+0
58
+```