Signed-off-by: Misty Stanley-Jones <misty@docker.com>
(cherry picked from commit 0ce13eb0d343e81db7006fd9c3e0c95ee1c3925c)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
| ... | ... |
@@ -35,7 +35,7 @@ Options: |
| 35 | 35 |
- name=<string> a container's name |
| 36 | 36 |
- network=(<network-id>|<network-name>) |
| 37 | 37 |
- since=(<container-name>|<container-id>) |
| 38 |
- - status=(created|restarting|removing|running|paused|exited) |
|
| 38 |
+ - status=(created|restarting|removing|running|paused|exited) |
|
| 39 | 39 |
- volume=(<volume name>|<mount point destination>) |
| 40 | 40 |
--format string Pretty-print containers using a Go template |
| 41 | 41 |
--help Print usage |
| ... | ... |
@@ -84,11 +84,11 @@ The currently supported filters are: |
| 84 | 84 |
* label (`label=<key>` or `label=<key>=<value>`) |
| 85 | 85 |
* name (container's name) |
| 86 | 86 |
* exited (int - the code of exited containers. Only useful with `--all`) |
| 87 |
-* status (created|restarting|running|removing|paused|exited|dead) |
|
| 87 |
+* status (`created|restarting|running|removing|paused|exited|dead`) |
|
| 88 | 88 |
* ancestor (`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) - filters containers that were created from the given image or a descendant. |
| 89 | 89 |
* before (container's id or name) - filters containers created before given id or name |
| 90 | 90 |
* since (container's id or name) - filters containers created since given id or name |
| 91 |
-* isolation (default|process|hyperv) (Windows daemon only) |
|
| 91 |
+* isolation (`default|process|hyperv`) (Windows daemon only) |
|
| 92 | 92 |
* volume (volume name or mount point) - filters containers that mount volumes. |
| 93 | 93 |
* network (network id or name) - filters containers connected to the provided network |
| 94 | 94 |
* health (starting|healthy|unhealthy|none) - filters containers based on healthcheck status |
| ... | ... |
@@ -249,12 +249,69 @@ For more information about named volumes, see |
| 249 | 249 |
The following table describes options which apply to both bind-mounts and named |
| 250 | 250 |
volumes in a service: |
| 251 | 251 |
|
| 252 |
-| Option | Required | Description |
|
| 253 |
-|:-----------------------------------------|:--------------------------|:----------------------------------------------------------------------------------------- |
|
| 254 |
-| **type** | | The type of mount, can be either `volume`, `bind`, or `tmpfs`. Defaults to `volume` if no type is specified.<ul><li>`volume`: mounts a [managed volume](volume_create.md) into the container.</li><li>`bind`: bind-mounts a directory or file from the host into the container.</li><li>`tmpfs`: mount a tmpfs in the container</li></ul> |
|
| 255 |
-| **src** or **source** | for `type=bind` only | <ul><li>`type=volume`: `src` is an optional way to specify the name of the volume (for example, `src=my-volume`). If the named volume does not exist, it is automatically created. If no `src` is specified, the volume is assigned a random name which is guaranteed to be unique on the host, but may not be unique cluster-wide. A randomly-named volume has the same lifecycle as its container and is destroyed when the *container* is destroyed (which is upon `service update`, or when scaling or re-balancing the service).</li><li>`type=bind`: `src` is required, and specifies an absolute path to the file or directory to bind-mount (for example, `src=/path/on/host/`). An error is produced if the file or directory does not exist.</li><li>`type=tmpfs`: `src` is not supported.</li></ul> |
|
| 256 |
-| **dst** or **destination** or **target** | yes | Mount path inside the container, for example `/some/path/in/container/`. If the path does not exist in the container's filesystem, the Engine creates a directory at the specified location before mounting the volume or bind-mount. |
|
| 257 |
-| **readonly** or **ro** | | The Engine mounts binds and volumes `read-write` unless `readonly` option is given when mounting the bind or volume.<br /><br /><ul><li>`true` or `1` or no value: Mounts the bind or volume read-only.</li><li>`false` or `0`: Mounts the bind or volume read-write.</li></ul> |
|
| 252 |
+<table> |
|
| 253 |
+ <tr> |
|
| 254 |
+ <th>Option</th> |
|
| 255 |
+ <th>Required</th> |
|
| 256 |
+ <th>Description</th> |
|
| 257 |
+ </tr> |
|
| 258 |
+ <tr> |
|
| 259 |
+ <td><b>types</b></td> |
|
| 260 |
+ <td></td> |
|
| 261 |
+ <td> |
|
| 262 |
+ <p>The type of mount, can be either <tt>volume</tt>, <tt>bind</tt>, or <tt>tmpfs</tt>. Defaults to <tt>volume</tt> if no type is specified. |
|
| 263 |
+ <ul> |
|
| 264 |
+ <li><tt>volume</tt>: mounts a [managed volume](volume_create.md) into the container.</li> |
|
| 265 |
+ <li><tt>bind</tt>: bind-mounts a directory or file from the host into the container.</li> |
|
| 266 |
+ <li><tt>tmpfs</tt>: mount a tmpfs in the container</li> |
|
| 267 |
+ </ul></p> |
|
| 268 |
+ </td> |
|
| 269 |
+ </tr> |
|
| 270 |
+ <tr> |
|
| 271 |
+ <td><b>src</b> or <b>source</b></td> |
|
| 272 |
+ <td>for <tt>type=bind</tt> only></td> |
|
| 273 |
+ <td> |
|
| 274 |
+ <ul> |
|
| 275 |
+ <li> |
|
| 276 |
+ <tt>type=volume</tt>: <tt>src</tt> is an optional way to specify the name of the volume (for example, <tt>src=my-volume</tt>). |
|
| 277 |
+ If the named volume does not exist, it is automatically created. If no <tt>src</tt> is specified, the volume is |
|
| 278 |
+ assigned a random name which is guaranteed to be unique on the host, but may not be unique cluster-wide. |
|
| 279 |
+ A randomly-named volume has the same lifecycle as its container and is destroyed when the <i>container</i> |
|
| 280 |
+ is destroyed (which is upon <tt>service update</tt>, or when scaling or re-balancing the service) |
|
| 281 |
+ </li> |
|
| 282 |
+ <li> |
|
| 283 |
+ <tt>type=bind</tt>: <tt>src</tt> is required, and specifies an absolute path to the file or directory to bind-mount |
|
| 284 |
+ (for example, <tt>src=/path/on/host/</tt>). An error is produced if the file or directory does not exist. |
|
| 285 |
+ </li> |
|
| 286 |
+ <li> |
|
| 287 |
+ <tt>type=tmpfs</tt>: <tt>src</tt> is not supported. |
|
| 288 |
+ </li> |
|
| 289 |
+ </ul> |
|
| 290 |
+ </td> |
|
| 291 |
+ </tr> |
|
| 292 |
+ <tr> |
|
| 293 |
+ <td><p><b>dst</b> or <b>destination</b> or <b>target</b></p></td> |
|
| 294 |
+ <td>yes</td> |
|
| 295 |
+ <td> |
|
| 296 |
+ <p>Mount path inside the container, for example <tt>/some/path/in/container/</tt>. |
|
| 297 |
+ If the path does not exist in the container's filesystem, the Engine creates |
|
| 298 |
+ a directory at the specified location before mounting the volume or bind-mount.</p> |
|
| 299 |
+ </td> |
|
| 300 |
+ </tr> |
|
| 301 |
+ <tr> |
|
| 302 |
+ <td><p><b>readonly</b> or <b>ro</b></p></td> |
|
| 303 |
+ <td></td> |
|
| 304 |
+ <td> |
|
| 305 |
+ <p>The Engine mounts binds and volumes <tt>read-write</tt> unless <tt>readonly</tt> option |
|
| 306 |
+ is given when mounting the bind or volume. |
|
| 307 |
+ <ul> |
|
| 308 |
+ <li><tt>true</tt> or <tt>1</tt> or no value: Mounts the bind or volume read-only.</li> |
|
| 309 |
+ <li><tt>false</tt> or <tt>0</tt>: Mounts the bind or volume read-write.</li> |
|
| 310 |
+ </ul></p> |
|
| 311 |
+ </td> |
|
| 312 |
+ </tr> |
|
| 313 |
+</table> |
|
| 314 |
+ |
|
| 258 | 315 |
|
| 259 | 316 |
#### Bind Propagation |
| 260 | 317 |
|
| ... | ... |
@@ -294,22 +351,84 @@ For more information about bind propagation, see the |
| 294 | 294 |
[Linux kernel documentation for shared subtree](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). |
| 295 | 295 |
|
| 296 | 296 |
#### Options for Named Volumes |
| 297 |
+ |
|
| 297 | 298 |
The following options can only be used for named volumes (`type=volume`); |
| 298 | 299 |
|
| 299 |
-| Option | Description |
|
| 300 |
-|:----------------------|:-------------------------------------------------------------------------------------------------------------------- |
|
| 301 |
-| **volume-driver** | Name of the volume-driver plugin to use for the volume. Defaults to ``"local"``, to use the local volume driver to create the volume if the volume does not exist. |
|
| 302 |
-| **volume-label** | One or more custom metadata ("labels") to apply to the volume upon creation. For example, `volume-label=mylabel=hello-world,my-other-label=hello-mars`. For more information about labels, refer to [apply custom metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/).
|
|
| 303 |
-| **volume-nocopy** | By default, if you attach an empty volume to a container, and files or directories already existed at the mount-path in the container (`dst`), the Engine copies those files and directories into the volume, allowing the host to access them. Set `volume-nocopy` to disables copying files from the container's filesystem to the volume and mount the empty volume.<br /><br />A value is optional:<ul><li>`true` or `1`: Default if you do not provide a value. Disables copying.</li><li>`false` or `0`: Enables copying.</li></ul> |
|
| 304 |
-| **volume-opt** | Options specific to a given volume driver, which will be passed to the driver when creating the volume. Options are provided as a comma-separated list of key/value pairs, for example, `volume-opt=some-option=some-value,some-other-option=some-other-value`. For available options for a given driver, refer to that driver's documentation. |
|
| 300 |
+ |
|
| 301 |
+<table> |
|
| 302 |
+ <tr> |
|
| 303 |
+ <th>Option</th> |
|
| 304 |
+ <th>Description</th> |
|
| 305 |
+ </tr> |
|
| 306 |
+ <tr> |
|
| 307 |
+ <td><b>volume-driver</b></td> |
|
| 308 |
+ <td> |
|
| 309 |
+ <p>Name of the volume-driver plugin to use for the volume. Defaults to |
|
| 310 |
+ <tt>"local"</tt>, to use the local volume driver to create the volume if the |
|
| 311 |
+ volume does not exist.</p> |
|
| 312 |
+ </td> |
|
| 313 |
+ </tr> |
|
| 314 |
+ <tr> |
|
| 315 |
+ <td><b>volume-label</b></td> |
|
| 316 |
+ <td> |
|
| 317 |
+ One or more custom metadata ("labels") to apply to the volume upon
|
|
| 318 |
+ creation. For example, |
|
| 319 |
+ `volume-label=mylabel=hello-world,my-other-label=hello-mars`. For more |
|
| 320 |
+ information about labels, refer to |
|
| 321 |
+ <a href="https://docs.docker.com/engine/userguide/labels-custom-metadata/">apply custom metadata</a>. |
|
| 322 |
+ </td> |
|
| 323 |
+ </tr> |
|
| 324 |
+ <tr> |
|
| 325 |
+ <td><b>volume-nocopy</b></td> |
|
| 326 |
+ <td> |
|
| 327 |
+ By default, if you attach an empty volume to a container, and files or |
|
| 328 |
+ directories already existed at the mount-path in the container (<tt>dst</tt>), |
|
| 329 |
+ the Engine copies those files and directories into the volume, allowing |
|
| 330 |
+ the host to access them. Set `volume-nocopy` to disables copying files |
|
| 331 |
+ from the container's filesystem to the volume and mount the empty volume. |
|
| 332 |
+ |
|
| 333 |
+ A value is optional: |
|
| 334 |
+ |
|
| 335 |
+ <ul> |
|
| 336 |
+ <li><tt>true</tt> or <tt>1</tt>: Default if you do not provide a value. Disables copying.</li> |
|
| 337 |
+ <li><tt>false</tt> or <tt>0</tt>: Enables copying.</li> |
|
| 338 |
+ </ul> |
|
| 339 |
+ </td> |
|
| 340 |
+ </tr> |
|
| 341 |
+ <tr> |
|
| 342 |
+ <td><b>volume-opt</b></td> |
|
| 343 |
+ <td> |
|
| 344 |
+ Options specific to a given volume driver, which will be passed to the |
|
| 345 |
+ driver when creating the volume. Options are provided as a comma-separated |
|
| 346 |
+ list of key/value pairs, for example, |
|
| 347 |
+ <tt>volume-opt=some-option=some-value,some-other-option=some-other-value</tt>. |
|
| 348 |
+ For available options for a given driver, refer to that driver's |
|
| 349 |
+ documentation. |
|
| 350 |
+ </td> |
|
| 351 |
+ </tr> |
|
| 352 |
+</table> |
|
| 353 |
+ |
|
| 305 | 354 |
|
| 306 | 355 |
#### Options for tmpfs |
| 356 |
+ |
|
| 307 | 357 |
The following options can only be used for tmpfs mounts (`type=tmpfs`); |
| 308 | 358 |
|
| 309 |
-| Option | Description |
|
| 310 |
-|:----------------------|:-------------------------------------------------------------------------------------------------------------------- |
|
| 311 |
-| **tmpfs-size** | Size of the tmpfs mount in bytes. Unlimited by default in Linux. |
|
| 312 |
-| **tmpfs-mode** | File mode of the tmpfs in octal. (e.g. `"700"` or `"0700"`.) Defaults to ``"1777"`` in Linux. |
|
| 359 |
+ |
|
| 360 |
+<table> |
|
| 361 |
+ <tr> |
|
| 362 |
+ <th>Option</th> |
|
| 363 |
+ <th>Description</th> |
|
| 364 |
+ </tr> |
|
| 365 |
+ <tr> |
|
| 366 |
+ <td><b>tmpfs-size</b></td> |
|
| 367 |
+ <td>Size of the tmpfs mount in bytes. Unlimited by default in Linux.</td> |
|
| 368 |
+ </tr> |
|
| 369 |
+ <tr> |
|
| 370 |
+ <td><b>tmpfs-mode</b></td> |
|
| 371 |
+ <td>File mode of the tmpfs in octal. (e.g. <tt>"700"</tt> or <tt>"0700"</tt>.) Defaults to <tt>"1777"</tt> in Linux.</td> |
|
| 372 |
+ </tr> |
|
| 373 |
+</table> |
|
| 374 |
+ |
|
| 313 | 375 |
|
| 314 | 376 |
#### Differences between "--mount" and "--volume" |
| 315 | 377 |
|
| ... | ... |
@@ -412,13 +531,40 @@ constraint expressions. Multiple constraints find nodes that satisfy every |
| 412 | 412 |
expression (AND match). Constraints can match node or Docker Engine labels as |
| 413 | 413 |
follows: |
| 414 | 414 |
|
| 415 |
-| node attribute | matches | example | |
|
| 416 |
-|:----------------|:--------------------------|:------------------------------------------------| |
|
| 417 |
-| node.id | node ID | `node.id == 2ivku8v2gvtg4` | |
|
| 418 |
-| node.hostname | node hostname | `node.hostname != node-2` | |
|
| 419 |
-| node.role | node role: manager | `node.role == manager` | |
|
| 420 |
-| node.labels | user defined node labels | `node.labels.security == high` | |
|
| 421 |
-| engine.labels | Docker Engine's labels | `engine.labels.operatingsystem == ubuntu 14.04` | |
|
| 415 |
+ |
|
| 416 |
+<table> |
|
| 417 |
+ <tr> |
|
| 418 |
+ <th>node attribute</th> |
|
| 419 |
+ <th>matches</th> |
|
| 420 |
+ <th>example</th> |
|
| 421 |
+ </tr> |
|
| 422 |
+ <tr> |
|
| 423 |
+ <td><tt>node.id</tt></td> |
|
| 424 |
+ <td>Node ID</td> |
|
| 425 |
+ <td><tt>node.id == 2ivku8v2gvtg4</tt></td> |
|
| 426 |
+ </tr> |
|
| 427 |
+ <tr> |
|
| 428 |
+ <td><tt>node.hostname</tt></td> |
|
| 429 |
+ <td>Node hostname</td> |
|
| 430 |
+ <td><tt>node.hostname != node-2</tt></td> |
|
| 431 |
+ </tr> |
|
| 432 |
+ <tr> |
|
| 433 |
+ <td<tt>node.role</tt></td> |
|
| 434 |
+ <td><tt>node role: manager</tt></td> |
|
| 435 |
+ <td><tt>node.role == manager</tt></td> |
|
| 436 |
+ </tr> |
|
| 437 |
+ <tr> |
|
| 438 |
+ <td><tt>node.labels</tt></td> |
|
| 439 |
+ <td>user defined node labels</td> |
|
| 440 |
+ <td><tt>node.labels.security == high</tt></td> |
|
| 441 |
+ </tr> |
|
| 442 |
+ <tr> |
|
| 443 |
+ <td><tt>engine.labels</tt></td> |
|
| 444 |
+ <td>Docker Engine's labels</td> |
|
| 445 |
+ <td><tt>engine.labels.operatingsystem == ubuntu 14.04</tt></td> |
|
| 446 |
+ </tr> |
|
| 447 |
+</table> |
|
| 448 |
+ |
|
| 422 | 449 |
|
| 423 | 450 |
`engine.labels` apply to Docker Engine labels like operating system, |
| 424 | 451 |
drivers, etc. Swarm administrators add `node.labels` for operational purposes by |
| ... | ... |
@@ -530,15 +676,42 @@ The supported flags are the following : |
| 530 | 530 |
|
| 531 | 531 |
Valid placeholders for the Go template are listed below: |
| 532 | 532 |
|
| 533 |
-Placeholder | Description |
|
| 534 |
-`.Service.ID` | Service ID |
|
| 535 |
-`.Service.Name` | Service name |
|
| 536 |
-`.Service.Labels` | Service labels |
|
| 537 |
-`.Node.ID` | Node ID |
|
| 538 |
-`.Task.ID` | Task ID |
|
| 539 |
-`.Task.Name` | Task name |
|
| 540 |
-`.Task.Slot` | Task slot |
|
| 533 |
+ |
|
| 534 |
+<table> |
|
| 535 |
+ <tr> |
|
| 536 |
+ <th>Placeholder</th> |
|
| 537 |
+ <th>Description</th> |
|
| 538 |
+ </tr> |
|
| 539 |
+ <tr> |
|
| 540 |
+ <td><tt>.Service.ID</tt></td> |
|
| 541 |
+ <td>Service ID</td> |
|
| 542 |
+ </tr> |
|
| 543 |
+ <tr> |
|
| 544 |
+ <td><tt>.Service.Name</tt></td> |
|
| 545 |
+ <td>Service name</td> |
|
| 546 |
+ </tr> |
|
| 547 |
+ <tr> |
|
| 548 |
+ <td><tt>.Service.Labels</tt></td> |
|
| 549 |
+ <td>Service labels</td> |
|
| 550 |
+ </tr> |
|
| 551 |
+ <tr> |
|
| 552 |
+ <td><tt>.Node.ID</tt></td> |
|
| 553 |
+ <td>Node ID</td> |
|
| 554 |
+ </tr> |
|
| 555 |
+ <tr> |
|
| 556 |
+ <td><tt>.Task.ID</tt></td> |
|
| 557 |
+ <td>Task ID</td> |
|
| 558 |
+ </tr> |
|
| 559 |
+ <tr> |
|
| 560 |
+ <td><tt>.Task.Name</tt></td> |
|
| 561 |
+ <td>Task name</td> |
|
| 562 |
+ </tr> |
|
| 563 |
+ <tr> |
|
| 564 |
+ <td><tt>.Task.Slot</tt></td> |
|
| 565 |
+ <td>Task slot</td> |
|
| 566 |
+ </tr> |
|
| 567 |
+</table> |
|
| 568 |
+ |
|
| 541 | 569 |
|
| 542 | 570 |
#### Template example |
| 543 | 571 |
|
| ... | ... |
@@ -27,12 +27,12 @@ Options: |
| 27 | 27 |
-q, --quiet Only display IDs |
| 28 | 28 |
``` |
| 29 | 29 |
|
| 30 |
-### Description |
|
| 30 |
+## Description |
|
| 31 | 31 |
|
| 32 | 32 |
Lists the services that are running as part of the specified stack. This |
| 33 | 33 |
command has to be run targeting a manager node. |
| 34 | 34 |
|
| 35 |
-### Examples |
|
| 35 |
+## Examples |
|
| 36 | 36 |
|
| 37 | 37 |
The following command shows all services in the `myapp` stack: |
| 38 | 38 |
|