remove Jekyll tags from CLI reference
(cherry picked from commit 9321a12115466a46013dd2258cd9ad658d303c48)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -168,7 +168,6 @@ attach`, `docker exec`, `docker run` or `docker start` command. |
| 168 | 168 |
Following is a sample `config.json` file: |
| 169 | 169 |
|
| 170 | 170 |
```json |
| 171 |
-{% raw %}
|
|
| 172 | 171 |
{
|
| 173 | 172 |
"HttpHeaders": {
|
| 174 | 173 |
"MyHeader": "MyValue" |
| ... | ... |
@@ -184,7 +183,6 @@ Following is a sample `config.json` file: |
| 184 | 184 |
"unicorn.example.com": "vcbait" |
| 185 | 185 |
} |
| 186 | 186 |
} |
| 187 |
-{% endraw %}
|
|
| 188 | 187 |
``` |
| 189 | 188 |
|
| 190 | 189 |
### Notary |
| ... | ... |
@@ -72,7 +72,6 @@ svendowideit/testimage version3 f5283438590d 16 sec |
| 72 | 72 |
### Commit a container with new configurations |
| 73 | 73 |
|
| 74 | 74 |
```bash |
| 75 |
-{% raw %}
|
|
| 76 | 75 |
$ docker ps |
| 77 | 76 |
|
| 78 | 77 |
ICONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| ... | ... |
@@ -90,7 +89,6 @@ f5283438590d |
| 90 | 90 |
$ docker inspect -f "{{ .Config.Env }}" f5283438590d
|
| 91 | 91 |
|
| 92 | 92 |
[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true] |
| 93 |
-{% endraw %}
|
|
| 94 | 93 |
``` |
| 95 | 94 |
|
| 96 | 95 |
### Commit a container with new `CMD` and `EXPOSE` instructions |
| ... | ... |
@@ -68,7 +68,6 @@ fraction of a second no more than nine digits long. |
| 68 | 68 |
The following removes containers created more than 5 minutes ago: |
| 69 | 69 |
|
| 70 | 70 |
```bash |
| 71 |
-{% raw %}
|
|
| 72 | 71 |
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
|
| 73 | 72 |
|
| 74 | 73 |
CONTAINER ID IMAGE COMMAND CREATED AT STATUS |
| ... | ... |
@@ -86,13 +85,11 @@ $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}
|
| 86 | 86 |
|
| 87 | 87 |
CONTAINER ID IMAGE COMMAND CREATED AT STATUS |
| 88 | 88 |
61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 44 seconds ago |
| 89 |
-{% endraw %}
|
|
| 90 | 89 |
``` |
| 91 | 90 |
|
| 92 | 91 |
The following removes containers created before `2017-01-04T13:10:00`: |
| 93 | 92 |
|
| 94 | 93 |
```bash |
| 95 |
-{% raw %}
|
|
| 96 | 94 |
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
|
| 97 | 95 |
|
| 98 | 96 |
CONTAINER ID IMAGE COMMAND CREATED AT STATUS |
| ... | ... |
@@ -110,7 +107,6 @@ $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}
|
| 110 | 110 |
|
| 111 | 111 |
CONTAINER ID IMAGE COMMAND CREATED AT STATUS |
| 112 | 112 |
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 9 minutes ago |
| 113 |
-{% endraw %}
|
|
| 114 | 113 |
``` |
| 115 | 114 |
|
| 116 | 115 |
## Related commands |
| ... | ... |
@@ -326,7 +326,6 @@ $ docker events --filter 'type=plugin' |
| 326 | 326 |
### Format the output |
| 327 | 327 |
|
| 328 | 328 |
```bash |
| 329 |
-{% raw %}
|
|
| 330 | 329 |
$ docker events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}'
|
| 331 | 330 |
|
| 332 | 331 |
Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
| ... | ... |
@@ -335,13 +334,11 @@ Type=container Status=start ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c1 |
| 335 | 335 |
Type=container Status=resize ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
| 336 | 336 |
Type=container Status=die ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
| 337 | 337 |
Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 |
| 338 |
-{% endraw %}
|
|
| 339 | 338 |
``` |
| 340 | 339 |
|
| 341 | 340 |
#### Format as JSON |
| 342 | 341 |
|
| 343 | 342 |
```none |
| 344 |
-{% raw %}
|
|
| 345 | 343 |
$ docker events --format '{{json .}}'
|
| 346 | 344 |
|
| 347 | 345 |
{"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
| ... | ... |
@@ -349,5 +346,4 @@ Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299 |
| 349 | 349 |
{"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e..
|
| 350 | 350 |
{"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42..
|
| 351 | 351 |
{"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4..
|
| 352 |
-{% endraw %}
|
|
| 353 | 352 |
``` |
| ... | ... |
@@ -91,7 +91,6 @@ fraction of a second no more than nine digits long. |
| 91 | 91 |
The following removes images created before `2017-01-04T00:00:00`: |
| 92 | 92 |
|
| 93 | 93 |
```bash |
| 94 |
-{% raw %}
|
|
| 95 | 94 |
$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
|
| 96 | 95 |
REPOSITORY TAG IMAGE ID CREATED AT SIZE |
| 97 | 96 |
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB |
| ... | ... |
@@ -114,7 +113,6 @@ $ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt
|
| 114 | 114 |
|
| 115 | 115 |
REPOSITORY TAG IMAGE ID CREATED AT SIZE |
| 116 | 116 |
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB |
| 117 |
-{% endraw %}
|
|
| 118 | 117 |
``` |
| 119 | 118 |
|
| 120 | 119 |
The following removes images created more than 10 days (`240h`) ago: |
| ... | ... |
@@ -309,7 +309,6 @@ The following example uses a template without headers and outputs the |
| 309 | 309 |
`ID` and `Repository` entries separated by a colon for all images: |
| 310 | 310 |
|
| 311 | 311 |
```bash |
| 312 |
-{% raw %}
|
|
| 313 | 312 |
$ docker images --format "{{.ID}}: {{.Repository}}"
|
| 314 | 313 |
|
| 315 | 314 |
77af4d6b9913: <none> |
| ... | ... |
@@ -321,14 +320,12 @@ b6fa739cedf5: committ |
| 321 | 321 |
746b819f315e: postgres |
| 322 | 322 |
746b819f315e: postgres |
| 323 | 323 |
746b819f315e: postgres |
| 324 |
-{% endraw %}
|
|
| 325 | 324 |
``` |
| 326 | 325 |
|
| 327 | 326 |
To list all images with their repository and tag in a table format you |
| 328 | 327 |
can use: |
| 329 | 328 |
|
| 330 | 329 |
```bash |
| 331 |
-{% raw %}
|
|
| 332 | 330 |
$ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}"
|
| 333 | 331 |
|
| 334 | 332 |
IMAGE ID REPOSITORY TAG |
| ... | ... |
@@ -341,5 +338,4 @@ b6fa739cedf5 committ latest |
| 341 | 341 |
746b819f315e postgres 9.3 |
| 342 | 342 |
746b819f315e postgres 9.3.5 |
| 343 | 343 |
746b819f315e postgres latest |
| 344 |
-{% endraw %}
|
|
| 345 | 344 |
``` |
| ... | ... |
@@ -197,7 +197,6 @@ The global `-D` option causes all `docker` commands to output debug information. |
| 197 | 197 |
You can also specify the output format: |
| 198 | 198 |
|
| 199 | 199 |
```bash |
| 200 |
-{% raw %}
|
|
| 201 | 200 |
$ docker info --format '{{json .}}'
|
| 202 | 201 |
|
| 203 | 202 |
{"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...}
|
| ... | ... |
@@ -45,33 +45,25 @@ For the most part, you can pick out any field from the JSON in a fairly |
| 45 | 45 |
straightforward manner. |
| 46 | 46 |
|
| 47 | 47 |
```bash |
| 48 |
-{% raw %}
|
|
| 49 | 48 |
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID
|
| 50 |
-{% endraw %}
|
|
| 51 | 49 |
``` |
| 52 | 50 |
|
| 53 | 51 |
### Get an instance's MAC address |
| 54 | 52 |
|
| 55 | 53 |
```bash |
| 56 |
-{% raw %}
|
|
| 57 | 54 |
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID
|
| 58 |
-{% endraw %}
|
|
| 59 | 55 |
``` |
| 60 | 56 |
|
| 61 | 57 |
### Get an instance's log path |
| 62 | 58 |
|
| 63 | 59 |
```bash |
| 64 |
-{% raw %}
|
|
| 65 | 60 |
$ docker inspect --format='{{.LogPath}}' $INSTANCE_ID
|
| 66 |
-{% endraw %}
|
|
| 67 | 61 |
``` |
| 68 | 62 |
|
| 69 | 63 |
### Get an instance's image name |
| 70 | 64 |
|
| 71 | 65 |
```bash |
| 72 |
-{% raw %}
|
|
| 73 | 66 |
$ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID
|
| 74 |
-{% endraw %}
|
|
| 75 | 67 |
``` |
| 76 | 68 |
|
| 77 | 69 |
### List all port bindings |
| ... | ... |
@@ -80,9 +72,7 @@ You can loop over arrays and maps in the results to produce simple text |
| 80 | 80 |
output: |
| 81 | 81 |
|
| 82 | 82 |
```bash |
| 83 |
-{% raw %}
|
|
| 84 | 83 |
$ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID
|
| 85 |
-{% endraw %}
|
|
| 86 | 84 |
``` |
| 87 | 85 |
|
| 88 | 86 |
### Find a specific port mapping |
| ... | ... |
@@ -96,9 +86,7 @@ then `index` 0 contains the first object inside of that. Then we ask for |
| 96 | 96 |
the `HostPort` field to get the public address. |
| 97 | 97 |
|
| 98 | 98 |
```bash |
| 99 |
-{% raw %}
|
|
| 100 | 99 |
$ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID
|
| 101 |
-{% endraw %}
|
|
| 102 | 100 |
``` |
| 103 | 101 |
|
| 104 | 102 |
### Get a subsection in JSON format |
| ... | ... |
@@ -109,7 +97,5 @@ Docker adds a template function, `json`, which can be applied to get |
| 109 | 109 |
results in JSON format. |
| 110 | 110 |
|
| 111 | 111 |
```bash |
| 112 |
-{% raw %}
|
|
| 113 | 112 |
$ docker inspect --format='{{json .Config}}' $INSTANCE_ID
|
| 114 |
-{% endraw %}
|
|
| 115 | 113 |
``` |
| ... | ... |
@@ -109,7 +109,6 @@ $ docker node inspect swarm-manager |
| 109 | 109 |
### Specify an output format |
| 110 | 110 |
|
| 111 | 111 |
```none |
| 112 |
-{% raw %}
|
|
| 113 | 112 |
$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
|
| 114 | 113 |
|
| 115 | 114 |
false |
| ... | ... |
@@ -136,7 +135,6 @@ Plugins: |
| 136 | 136 |
Network: overlay, bridge, null, host, overlay |
| 137 | 137 |
Volume: local |
| 138 | 138 |
Engine Version: 1.12.0 |
| 139 |
-{% endraw %}
|
|
| 140 | 139 |
``` |
| 141 | 140 |
|
| 142 | 141 |
## Related commands |
| ... | ... |
@@ -148,11 +148,9 @@ $ docker plugin inspect tiborvass/sample-volume-plugin:latest |
| 148 | 148 |
### Formatting the output |
| 149 | 149 |
|
| 150 | 150 |
```bash |
| 151 |
-{% raw %}
|
|
| 152 | 151 |
$ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
|
| 153 | 152 |
|
| 154 | 153 |
8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21 |
| 155 |
-{% endraw %}
|
|
| 156 | 154 |
``` |
| 157 | 155 |
|
| 158 | 156 |
|
| ... | ... |
@@ -96,11 +96,9 @@ The following example uses a template without headers and outputs the |
| 96 | 96 |
`ID` and `Name` entries separated by a colon for all plugins: |
| 97 | 97 |
|
| 98 | 98 |
```bash |
| 99 |
-{% raw %}
|
|
| 100 | 99 |
$ docker plugin ls --format "{{.ID}}: {{.Name}}"
|
| 101 | 100 |
|
| 102 | 101 |
4be01827a72e: tiborvass/no-remove |
| 103 |
-{% endraw %}
|
|
| 104 | 102 |
``` |
| 105 | 103 |
|
| 106 | 104 |
|
| ... | ... |
@@ -42,7 +42,6 @@ The following example change the env variable `DEBUG` on the |
| 42 | 42 |
`sample-volume-plugin` plugin. |
| 43 | 43 |
|
| 44 | 44 |
```bash |
| 45 |
-{% raw %}
|
|
| 46 | 45 |
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
| 47 | 46 |
|
| 48 | 47 |
[DEBUG=0] |
| ... | ... |
@@ -51,7 +50,6 @@ $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1 |
| 51 | 51 |
|
| 52 | 52 |
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
|
| 53 | 53 |
[DEBUG=1] |
| 54 |
-{% endraw %}
|
|
| 55 | 54 |
``` |
| 56 | 55 |
|
| 57 | 56 |
### Change the source of a mount |
| ... | ... |
@@ -60,7 +58,6 @@ The following example change the source of the `mymount` mount on |
| 60 | 60 |
the `myplugin` plugin. |
| 61 | 61 |
|
| 62 | 62 |
```bash |
| 63 |
-{% raw %}
|
|
| 64 | 63 |
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
| 65 | 64 |
/foo |
| 66 | 65 |
|
| ... | ... |
@@ -68,7 +65,6 @@ $ docker plugins set myplugin mymount.source=/bar |
| 68 | 68 |
|
| 69 | 69 |
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
|
| 70 | 70 |
/bar |
| 71 |
-{% endraw %}
|
|
| 72 | 71 |
``` |
| 73 | 72 |
|
| 74 | 73 |
> **Note**: Since only `source` is settable in `mymount`, |
| ... | ... |
@@ -80,7 +76,6 @@ The following example change the path of the `mydevice` device on |
| 80 | 80 |
the `myplugin` plugin. |
| 81 | 81 |
|
| 82 | 82 |
```bash |
| 83 |
-{% raw %}
|
|
| 84 | 83 |
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
| 85 | 84 |
/dev/foo |
| 86 | 85 |
|
| ... | ... |
@@ -88,7 +83,6 @@ $ docker plugins set myplugin mydevice.path=/dev/bar |
| 88 | 88 |
|
| 89 | 89 |
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
|
| 90 | 90 |
/dev/bar |
| 91 |
-{% endraw %}
|
|
| 92 | 91 |
``` |
| 93 | 92 |
|
| 94 | 93 |
> **Note**: Since only `path` is settable in `mydevice`, |
| ... | ... |
@@ -99,7 +93,6 @@ $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$devi
|
| 99 | 99 |
The following example change the source of the args on the `myplugin` plugin. |
| 100 | 100 |
|
| 101 | 101 |
```bash |
| 102 |
-{% raw %}
|
|
| 103 | 102 |
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
| 104 | 103 |
["foo", "bar"] |
| 105 | 104 |
|
| ... | ... |
@@ -107,7 +100,6 @@ $ docker plugins set myplugin args="foo bar baz" |
| 107 | 107 |
|
| 108 | 108 |
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
|
| 109 | 109 |
["foo", "bar", "baz"] |
| 110 |
-{% endraw %}
|
|
| 111 | 110 |
``` |
| 112 | 111 |
|
| 113 | 112 |
## Related commands |
| ... | ... |
@@ -296,7 +296,6 @@ The `volume` filter shows only containers that mount a specific volume or have |
| 296 | 296 |
a volume mounted in a specific path: |
| 297 | 297 |
|
| 298 | 298 |
```bash |
| 299 |
-{% raw %}
|
|
| 300 | 299 |
$ docker ps --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}"
|
| 301 | 300 |
CONTAINER ID MOUNTS |
| 302 | 301 |
9c3527ed70ce remote-volume |
| ... | ... |
@@ -304,7 +303,6 @@ CONTAINER ID MOUNTS |
| 304 | 304 |
$ docker ps --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}"
|
| 305 | 305 |
CONTAINER ID MOUNTS |
| 306 | 306 |
9c3527ed70ce remote-volume |
| 307 |
-{% endraw %}
|
|
| 308 | 307 |
``` |
| 309 | 308 |
|
| 310 | 309 |
#### network |
| ... | ... |
@@ -330,9 +328,7 @@ example shows all containers that are attached to the `net1` network, using |
| 330 | 330 |
the network id as a filter; |
| 331 | 331 |
|
| 332 | 332 |
```bash |
| 333 |
-{% raw %}
|
|
| 334 | 333 |
$ docker network inspect --format "{{.ID}}" net1
|
| 335 |
-{% endraw %}
|
|
| 336 | 334 |
|
| 337 | 335 |
8c0b4110ae930dbe26b258de9bc34a03f98056ed6f27f991d32919bfe401d7c5 |
| 338 | 336 |
|
| ... | ... |
@@ -399,7 +395,7 @@ Placeholder | Description |
| 399 | 399 |
`.Size` | Container disk size. |
| 400 | 400 |
`.Names` | Container names. |
| 401 | 401 |
`.Labels` | All labels assigned to the container. |
| 402 |
-`.Label` | Value of a specific label for this container. For example `'{% raw %}{{.Label "com.docker.swarm.cpu"}}{% endraw %}'`
|
|
| 402 |
+`.Label` | Value of a specific label for this container. For example `'{{.Label "com.docker.swarm.cpu"}}'`
|
|
| 403 | 403 |
`.Mounts` | Names of the volumes mounted in this container. |
| 404 | 404 |
`.Networks` | Names of the networks attached to this container. |
| 405 | 405 |
|
| ... | ... |
@@ -411,9 +407,7 @@ The following example uses a template without headers and outputs the `ID` and |
| 411 | 411 |
`Command` entries separated by a colon for all running containers: |
| 412 | 412 |
|
| 413 | 413 |
```bash |
| 414 |
-{% raw %}
|
|
| 415 | 414 |
$ docker ps --format "{{.ID}}: {{.Command}}"
|
| 416 |
-{% endraw %}
|
|
| 417 | 415 |
|
| 418 | 416 |
a87ecb4f327c: /bin/sh -c #(nop) MA |
| 419 | 417 |
01946d9d34d8: /bin/sh -c #(nop) MA |
| ... | ... |
@@ -424,9 +418,7 @@ c1d3b0166030: /bin/sh -c yum -y up |
| 424 | 424 |
To list all running containers with their labels in a table format you can use: |
| 425 | 425 |
|
| 426 | 426 |
```bash |
| 427 |
-{% raw %}
|
|
| 428 | 427 |
$ docker ps --format "table {{.ID}}\t{{.Labels}}"
|
| 429 |
-{% endraw %}
|
|
| 430 | 428 |
|
| 431 | 429 |
CONTAINER ID LABELS |
| 432 | 430 |
a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd |
| ... | ... |
@@ -542,7 +542,6 @@ retrieve the container's ID once the container has finished running. |
| 542 | 542 |
### Add host device to container (--device) |
| 543 | 543 |
|
| 544 | 544 |
```bash |
| 545 |
-{% raw %}
|
|
| 546 | 545 |
$ docker run --device=/dev/sdc:/dev/xvdc \ |
| 547 | 546 |
--device=/dev/sdd --device=/dev/zero:/dev/nulo \ |
| 548 | 547 |
-i -t \ |
| ... | ... |
@@ -551,7 +550,6 @@ $ docker run --device=/dev/sdc:/dev/xvdc \ |
| 551 | 551 |
brw-rw---- 1 root disk 8, 2 Feb 9 16:05 /dev/xvdc |
| 552 | 552 |
brw-rw---- 1 root disk 8, 3 Feb 9 16:05 /dev/sdd |
| 553 | 553 |
crw-rw-rw- 1 root root 1, 5 Feb 9 16:05 /dev/nulo |
| 554 |
-{% endraw %}
|
|
| 555 | 554 |
``` |
| 556 | 555 |
|
| 557 | 556 |
It is often necessary to directly expose devices to a container. The `--device` |
| ... | ... |
@@ -635,10 +633,8 @@ using IPv4 or IPv6 networking in your containers. Use the following |
| 635 | 635 |
flags for IPv4 address retrieval for a network device named `eth0`: |
| 636 | 636 |
|
| 637 | 637 |
```bash |
| 638 |
-{% raw %}
|
|
| 639 | 638 |
$ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print \$2}' | cut -d / -f 1`
|
| 640 | 639 |
$ docker run --add-host=docker:${HOSTIP} --rm -it debian
|
| 641 |
-{% endraw %}
|
|
| 642 | 640 |
``` |
| 643 | 641 |
|
| 644 | 642 |
For IPv6 use the `-6` flag instead of the `-4` flag. For other network |
| ... | ... |
@@ -75,11 +75,9 @@ secret. The following example command outputs the creation time of the |
| 75 | 75 |
secret. |
| 76 | 76 |
|
| 77 | 77 |
```bash |
| 78 |
-{% raw %}
|
|
| 79 | 78 |
$ docker secret inspect --format='{{.CreatedAt}}' mhv17xfe3gh6xc4rij5orpfds
|
| 80 | 79 |
|
| 81 | 80 |
2016-10-27 23:25:43.909181089 +0000 UTC |
| 82 |
-{% endraw %}
|
|
| 83 | 81 |
``` |
| 84 | 82 |
|
| 85 | 83 |
|
| ... | ... |
@@ -546,9 +546,8 @@ In this example, we are going to set the template of the created containers base |
| 546 | 546 |
service's name and the node's ID where it sits. |
| 547 | 547 |
|
| 548 | 548 |
```bash |
| 549 |
-{% raw %}
|
|
| 550 | 549 |
$ docker service create --name hosttempl \ |
| 551 |
- --hostname={% raw %}"{{.Node.ID}}-{{.Service.Name}}"\
|
|
| 550 |
+ --hostname="{{.Node.ID}}-{{.Service.Name}}"\
|
|
| 552 | 551 |
busybox top |
| 553 | 552 |
|
| 554 | 553 |
va8ew30grofhjoychbr6iot8c |
| ... | ... |
@@ -561,7 +560,6 @@ wo41w8hg8qan hosttempl.1 busybox:latest@sha256:29f5d56d12684887bdfa50dcd29fc31 |
| 561 | 561 |
$ docker inspect --format="{{.Config.Hostname}}" hosttempl.1.wo41w8hg8qanxwjwsg4kxpprj
|
| 562 | 562 |
|
| 563 | 563 |
x3ti0erg11rjpg64m75kej2mz-hosttempl |
| 564 |
-{% endraw %}
|
|
| 565 | 564 |
``` |
| 566 | 565 |
|
| 567 | 566 |
## Related commands |
| ... | ... |
@@ -150,11 +150,9 @@ service. For example, the following command outputs the number of replicas |
| 150 | 150 |
of the "redis" service. |
| 151 | 151 |
|
| 152 | 152 |
```bash |
| 153 |
-{% raw %}
|
|
| 154 | 153 |
$ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis
|
| 155 | 154 |
|
| 156 | 155 |
10 |
| 157 |
-{% endraw %}
|
|
| 158 | 156 |
``` |
| 159 | 157 |
|
| 160 | 158 |
|
| ... | ... |
@@ -135,12 +135,10 @@ The following example uses a template without headers and outputs the |
| 135 | 135 |
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services: |
| 136 | 136 |
|
| 137 | 137 |
```bash |
| 138 |
-{% raw %}
|
|
| 139 | 138 |
$ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
|
| 140 | 139 |
|
| 141 | 140 |
0zmvwuiu3vue: replicated 10/10 |
| 142 | 141 |
fm6uf97exkul: global 5/5 |
| 143 |
-{% endraw %}
|
|
| 144 | 142 |
``` |
| 145 | 143 |
|
| 146 | 144 |
## Related commands |
| ... | ... |
@@ -89,12 +89,10 @@ The following example uses a template without headers and outputs the |
| 89 | 89 |
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services: |
| 90 | 90 |
|
| 91 | 91 |
```bash |
| 92 |
-{% raw %}
|
|
| 93 | 92 |
$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
|
| 94 | 93 |
|
| 95 | 94 |
0zmvwuiu3vue: replicated 10/10 |
| 96 | 95 |
fm6uf97exkul: global 5/5 |
| 97 |
-{% endraw %}
|
|
| 98 | 96 |
``` |
| 99 | 97 |
|
| 100 | 98 |
|
| ... | ... |
@@ -107,25 +107,21 @@ The following example uses a template without headers and outputs the |
| 107 | 107 |
`Container` and `CPUPerc` entries separated by a colon for all images: |
| 108 | 108 |
|
| 109 | 109 |
```bash |
| 110 |
-{% raw %}
|
|
| 111 | 110 |
$ docker stats --format "{{.Container}}: {{.CPUPerc}}"
|
| 112 | 111 |
|
| 113 | 112 |
09d3bb5b1604: 6.61% |
| 114 | 113 |
9db7aa4d986d: 9.19% |
| 115 | 114 |
3f214c61ad1d: 0.00% |
| 116 |
-{% endraw %}
|
|
| 117 | 115 |
``` |
| 118 | 116 |
|
| 119 | 117 |
To list all containers statistics with their name, CPU percentage and memory |
| 120 | 118 |
usage in a table format you can use: |
| 121 | 119 |
|
| 122 | 120 |
```bash |
| 123 |
-{% raw %}
|
|
| 124 | 121 |
$ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
|
| 125 | 122 |
|
| 126 | 123 |
CONTAINER CPU % PRIV WORKING SET |
| 127 | 124 |
1285939c1fd3 0.07% 796 KiB / 64 MiB |
| 128 | 125 |
9c76f7834ae2 0.07% 2.746 MiB / 64 MiB |
| 129 | 126 |
d1ea048f04e4 0.03% 4.583 MiB / 64 MiB |
| 130 |
-{% endraw %}
|
|
| 131 | 127 |
``` |
| ... | ... |
@@ -60,19 +60,15 @@ OS/Arch: linux/amd64 |
| 60 | 60 |
### Get the server version |
| 61 | 61 |
|
| 62 | 62 |
```bash |
| 63 |
-{% raw %}
|
|
| 64 | 63 |
$ docker version --format '{{.Server.Version}}'
|
| 65 | 64 |
|
| 66 | 65 |
1.8.0 |
| 67 |
-{% endraw %}
|
|
| 68 | 66 |
``` |
| 69 | 67 |
|
| 70 | 68 |
### Dump raw JSON data |
| 71 | 69 |
|
| 72 | 70 |
```bash |
| 73 |
-{% raw %}
|
|
| 74 | 71 |
$ docker version --format '{{json .}}'
|
| 75 | 72 |
|
| 76 | 73 |
{"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"}}
|
| 77 |
-{% endraw %}
|
|
| 78 | 74 |
``` |
| ... | ... |
@@ -48,10 +48,8 @@ $ docker volume inspect 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443 |
| 48 | 48 |
} |
| 49 | 49 |
] |
| 50 | 50 |
|
| 51 |
-{% raw %}
|
|
| 52 | 51 |
$ docker volume inspect --format '{{ .Mountpoint }}' 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d
|
| 53 | 52 |
/var/lib/docker/volumes/85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d/_data |
| 54 |
-{% endraw %}
|
|
| 55 | 53 |
``` |
| 56 | 54 |
|
| 57 | 55 |
## Related commands |
| ... | ... |
@@ -183,13 +183,11 @@ The following example uses a template without headers and outputs the |
| 183 | 183 |
`Name` and `Driver` entries separated by a colon for all volumes: |
| 184 | 184 |
|
| 185 | 185 |
```bash |
| 186 |
-{% raw %}
|
|
| 187 | 186 |
$ docker volume ls --format "{{.Name}}: {{.Driver}}"
|
| 188 | 187 |
|
| 189 | 188 |
vol1: local |
| 190 | 189 |
vol2: local |
| 191 | 190 |
vol3: local |
| 192 |
-{% endraw %}
|
|
| 193 | 191 |
``` |
| 194 | 192 |
|
| 195 | 193 |
## Related commands |