Update cli ref yaml for stable and edge (#2747)

This commit is contained in:
Misty Stanley-Jones 2017-04-12 16:51:51 -07:00 committed by GitHub
parent 455f904397
commit 51d9cf2ef8
71 changed files with 785 additions and 517 deletions

View File

@ -1,10 +1,13 @@
command: docker attach
short: Attach to a running container
long: |-
Use `docker attach` to attach to a running container using the container's ID
or name, either to view its ongoing output or to control it interactively.
Use `docker attach` to attach your terminal's standard input, output, and error
(or any combination of the three) to a running container using the container's
ID or name. This allows you to view its ongoing output or to control it
interactively, as though the commands were running directly in your terminal.
You can attach to the same contained process multiple times simultaneously,
screen sharing style, or quickly view the progress of your detached process.
even as a different user with the appropriate permissions.
To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the
container. If `--sig-proxy` is true (the default),`CTRL-c` sends a `SIGINT` to

View File

@ -103,6 +103,9 @@ usage: docker build [OPTIONS] PATH | URL | -
pname: docker
plink: docker.yaml
options:
- option: add-host
default_value: '[]'
description: Add a custom host-to-IP mapping (host:ip)
- option: build-arg
default_value: '[]'
description: Set build-time variables
@ -144,8 +147,10 @@ options:
description: Set metadata for an image
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: network
@ -169,7 +174,8 @@ options:
default_value: '[]'
description: Security options
- option: shm-size
description: Size of /dev/shm, default value is 64MB
default_value: "0"
description: Size of /dev/shm
- option: squash
default_value: "false"
description: Squash newly built layers into a single new layer
@ -255,7 +261,7 @@ examples: |-
This sends the URL `http://server/ctx.tar.gz` to the Docker daemon, which
downloads and extracts the referenced tarball. The `-f ctx/Dockerfile`
parameter specifies a path inside `ctx.tar.gz` to the `Dockerfile` that is used
to build the image. Any `ADD` commands in that `Dockerfile` that refer to local
to build the image. Any `ADD` commands in that `Dockerfile` that refers to local
paths must be relative to the root of the contents inside `ctx.tar.gz`. In the
example above, the tarball contains a directory `ctx/`, so the `ADD
ctx/container.cfg /` operation works as expected.
@ -426,12 +432,19 @@ examples: |-
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
### Add entries to container hosts file (--add-host)
You can add other hosts into a container's `/etc/hosts` file by using one or
more `--add-host` flags. This example adds a static address for a host named
`docker`:
$ docker build --add-host=docker:10.180.0.1 .
### Squash an image's layers (--squash) **Experimental Only**
Once the image is built, squash the new layers into a new image with a single
new layer. Squashing does not destroy any existing image, rather it creates a new
image with the content of the squshed layers. This effectively makes it look
image with the content of the squashed layers. This effectively makes it look
like all `Dockerfile` commands were created with a single layer. The build
cache is preserved with this method.

View File

@ -63,6 +63,9 @@ options:
- option: device
default_value: '[]'
description: Add a host device to the container
- option: device-cgroup-rule
default_value: '[]'
description: Add a rule to the cgroup allowed devices list
- option: device-read-bps
default_value: '[]'
description: Limit read rate (bytes per second) from a device
@ -134,20 +137,22 @@ options:
default_value: "false"
description: Keep STDIN open even if not attached
- option: io-maxbandwidth
default_value: "0"
description: |
Maximum IO bandwidth limit for the system drive (Windows only)
- option: io-maxiops
default_value: "0"
description: Maximum IOps limit for the system drive (Windows only)
- option: ip
description: Container IPv4 address (e.g. 172.30.100.104)
description: IPv4 address (e.g., 172.30.100.104)
- option: ip6
description: Container IPv6 address (e.g. 2001:db8::33)
description: IPv6 address (e.g., 2001:db8::33)
- option: ipc
description: IPC namespace to use
- option: isolation
description: Container isolation technology
- option: kernel-memory
default_value: "0"
description: Kernel memory limit
- option: label
shorthand: l
@ -168,13 +173,16 @@ options:
default_value: '[]'
description: Log driver options
- option: mac-address
description: Container MAC address (e.g. 92:d0:c6:0a:29:33)
description: Container MAC address (e.g., 92:d0:c6:0a:29:33)
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-reservation
default_value: "0"
description: Memory soft limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: memory-swappiness
@ -234,10 +242,11 @@ options:
default_value: '[]'
description: Security Options
- option: shm-size
description: Size of /dev/shm, default value is 64MB
default_value: "0"
description: Size of /dev/shm
- option: stop-signal
default_value: SIGTERM
description: Signal to stop a container, SIGTERM by default
description: Signal to stop a container
- option: stop-timeout
default_value: "0"
description: Timeout (in seconds) to stop a container

View File

@ -13,7 +13,8 @@ options:
default_value: "false"
description: Follow log output
- option: since
description: Show logs since timestamp
description: |
Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
- option: tail
default_value: all
description: Number of lines to show from the end of the logs

View File

@ -5,6 +5,8 @@ usage: docker container prune [OPTIONS]
pname: docker container
plink: docker_container.yaml
options:
- option: filter
description: Provide filter values (e.g. 'until=<timestamp>')
- option: force
shorthand: f
default_value: "false"
@ -47,6 +49,7 @@ examples: |-
The following removes containers created more than 5 minutes ago:
```bash
{% raw %}
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
@ -64,11 +67,13 @@ examples: |-
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 44 seconds ago
{% endraw %}
```
The following removes containers created before `2017-01-04T13:10:00`:
```bash
{% raw %}
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
@ -86,5 +91,6 @@ examples: |-
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 9 minutes ago
{% endraw %}
```

View File

@ -69,6 +69,9 @@ options:
- option: device
default_value: '[]'
description: Add a host device to the container
- option: device-cgroup-rule
default_value: '[]'
description: Add a rule to the cgroup allowed devices list
- option: device-read-bps
default_value: '[]'
description: Limit read rate (bytes per second) from a device
@ -140,20 +143,22 @@ options:
default_value: "false"
description: Keep STDIN open even if not attached
- option: io-maxbandwidth
default_value: "0"
description: |
Maximum IO bandwidth limit for the system drive (Windows only)
- option: io-maxiops
default_value: "0"
description: Maximum IOps limit for the system drive (Windows only)
- option: ip
description: Container IPv4 address (e.g. 172.30.100.104)
description: IPv4 address (e.g., 172.30.100.104)
- option: ip6
description: Container IPv6 address (e.g. 2001:db8::33)
description: IPv6 address (e.g., 2001:db8::33)
- option: ipc
description: IPC namespace to use
- option: isolation
description: Container isolation technology
- option: kernel-memory
default_value: "0"
description: Kernel memory limit
- option: label
shorthand: l
@ -174,13 +179,16 @@ options:
default_value: '[]'
description: Log driver options
- option: mac-address
description: Container MAC address (e.g. 92:d0:c6:0a:29:33)
description: Container MAC address (e.g., 92:d0:c6:0a:29:33)
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-reservation
default_value: "0"
description: Memory soft limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: memory-swappiness
@ -240,13 +248,14 @@ options:
default_value: '[]'
description: Security Options
- option: shm-size
description: Size of /dev/shm, default value is 64MB
default_value: "0"
description: Size of /dev/shm
- option: sig-proxy
default_value: "true"
description: Proxy received signals to the process
- option: stop-signal
default_value: SIGTERM
description: Signal to stop a container, SIGTERM by default
description: Signal to stop a container
- option: stop-timeout
default_value: "0"
description: Timeout (in seconds) to stop a container

View File

@ -30,13 +30,17 @@ options:
- option: cpuset-mems
description: MEMs in which to allow execution (0-3, 0,1)
- option: kernel-memory
default_value: "0"
description: Kernel memory limit
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-reservation
default_value: "0"
description: Memory soft limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: restart

View File

@ -74,6 +74,9 @@ options:
- option: device
default_value: '[]'
description: Add a host device to the container
- option: device-cgroup-rule
default_value: '[]'
description: Add a rule to the cgroup allowed devices list
- option: device-read-bps
default_value: '[]'
description: Limit read rate (bytes per second) from a device
@ -145,20 +148,22 @@ options:
default_value: "false"
description: Keep STDIN open even if not attached
- option: io-maxbandwidth
default_value: "0"
description: |
Maximum IO bandwidth limit for the system drive (Windows only)
- option: io-maxiops
default_value: "0"
description: Maximum IOps limit for the system drive (Windows only)
- option: ip
description: Container IPv4 address (e.g. 172.30.100.104)
description: IPv4 address (e.g., 172.30.100.104)
- option: ip6
description: Container IPv6 address (e.g. 2001:db8::33)
description: IPv6 address (e.g., 2001:db8::33)
- option: ipc
description: IPC namespace to use
- option: isolation
description: Container isolation technology
- option: kernel-memory
default_value: "0"
description: Kernel memory limit
- option: label
shorthand: l
@ -179,13 +184,16 @@ options:
default_value: '[]'
description: Log driver options
- option: mac-address
description: Container MAC address (e.g. 92:d0:c6:0a:29:33)
description: Container MAC address (e.g., 92:d0:c6:0a:29:33)
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-reservation
default_value: "0"
description: Memory soft limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: memory-swappiness
@ -245,10 +253,11 @@ options:
default_value: '[]'
description: Security Options
- option: shm-size
description: Size of /dev/shm, default value is 64MB
default_value: "0"
description: Size of /dev/shm
- option: stop-signal
default_value: SIGTERM
description: Signal to stop a container, SIGTERM by default
description: Signal to stop a container
- option: stop-timeout
default_value: "0"
description: Timeout (in seconds) to stop a container
@ -373,3 +382,26 @@ examples: |-
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
### Dealing with dynamically created devices (--device-cgroup-rule)
Devices available to a container are assigned at creation time. The
assigned devices will both be added to the cgroup.allow file and
created into the container once it is run. This poses a problem when
a new device needs to be added to running container.
One of the solution is to add a more permissive rule to a container
allowing it access to a wider range of devices. For example, supposing
our container needs access to a character device with major `42` and
any number of minor number (added as new devices appear), the
following rule would be added:
```
docker create --device-cgroup-rule='c 42:* rmw' -name my-container my-image
```
Then, a user could ask `udev` to execute a script that would `docker exec my-container mknod newDevX c 42 <minor>`
the required device when it is added.
NOTE: initially present devices still need to be explicitely added to
the create/run command

View File

@ -5,6 +5,9 @@ usage: docker image build [OPTIONS] PATH | URL | -
pname: docker image
plink: docker_image.yaml
options:
- option: add-host
default_value: '[]'
description: Add a custom host-to-IP mapping (host:ip)
- option: build-arg
default_value: '[]'
description: Set build-time variables
@ -46,8 +49,10 @@ options:
description: Set metadata for an image
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: network
@ -71,7 +76,8 @@ options:
default_value: '[]'
description: Security options
- option: shm-size
description: Size of /dev/shm, default value is 64MB
default_value: "0"
description: Size of /dev/shm
- option: squash
default_value: "false"
description: Squash newly built layers into a single new layer

View File

@ -10,6 +10,8 @@ options:
shorthand: a
default_value: "false"
description: Remove all unused images, not just dangling ones
- option: filter
description: Provide filter values (e.g. 'until=<timestamp>')
- option: force
shorthand: f
default_value: "false"
@ -74,6 +76,7 @@ examples: |2-
The following removes images created before `2017-01-04T00:00:00`:
```bash
{% raw %}
$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
REPOSITORY TAG IMAGE ID CREATED AT SIZE
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
@ -96,6 +99,7 @@ examples: |2-
REPOSITORY TAG IMAGE ID CREATED AT SIZE
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
{% endraw %}
```
The following removes images created more than 10 days (`240h`) ago:

View File

@ -7,5 +7,5 @@ plink: docker_image.yaml
options:
- option: disable-content-trust
default_value: "true"
description: Skip image verification
description: Skip image signing

View File

@ -20,7 +20,9 @@ long: "Login to a registry.\n\n### Login to a self-hosted registry\n\nIf you wan
Apple macOS keychain: https://github.com/docker/docker-credential-helpers/releases\n-
Microsoft Windows Credential Manager: https://github.com/docker/docker-credential-helpers/releases\n\nYou
need to specify the credentials store in `$HOME/.docker/config.json`\nto tell the
docker engine to use it:\n\n```json\n{\n\t\"credsStore\": \"osxkeychain\"\n}\n```\n\nIf
docker engine to use it. The value of the config property should be\nthe suffix
of the program to use (i.e. everything after `docker-credential-`).\nFor example,
to use `docker-credential-osxkeychain`:\n\n```json\n{\n\t\"credsStore\": \"osxkeychain\"\n}\n```\n\nIf
you are currently logged in, run `docker logout` to remove\nthe credentials from
the file and run `docker login` again.\n\n### Credential helper protocol\n\nCredential
helpers can be any program or script that follows a very simple protocol.\nThis

View File

@ -48,7 +48,8 @@ options:
default_value: "false"
description: Follow log output
- option: since
description: Show logs since timestamp
description: |
Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
- option: tail
default_value: all
description: Number of lines to show from the end of the logs

View File

@ -12,9 +12,9 @@ options:
default_value: '[]'
description: Add network-scoped alias for the container
- option: ip
description: IP Address
description: IPv4 address (e.g., 172.30.100.104)
- option: ip6
description: IPv6 Address
description: IPv6 address (e.g., 2001:db8::33)
- option: link
default_value: '[]'
description: Add link to another container

View File

@ -10,4 +10,8 @@ options:
- option: format
shorthand: f
description: Format the output using the given Go template
- option: verbose
shorthand: v
default_value: "false"
description: Verbose output for diagnostics

View File

@ -78,16 +78,16 @@ examples: "### List all networks\n\n```bash\n$ sudo docker network ls\nNETWORK I
type=custom -q`\n```\n\nA warning will be issued when trying to remove a network
that has containers\nattached.\n\n### Formatting\n\nThe formatting options (`--format`)
pretty-prints networks output\nusing a Go template.\n\nValid placeholders for the
Go template are listed below:\n\nPlaceholder | Description\n------------|------------------------------------------------------------------------------------------\n`.ID`
\ | Network ID\n`.Name` | Network name\n`.Driver` | Network driver\n`.Scope`
\ | Network scope (local, global)\n`.IPv6` | Whether IPv6 is enabled on the
network or not.\n`.Internal` | Whether the network is internal or not.\n`.Labels`
\ | All labels assigned to the network.\n`.Label` | Value of a specific label
for this network. For example `{{.Label \"project.version\"}}`\n\nWhen using the
`--format` option, the `network ls` command will either\noutput the data exactly
as the template declares or, when using the\n`table` directive, includes column
headers as well.\n\nThe following example uses a template without headers and outputs
the\n`ID` and `Driver` entries separated by a colon for all networks:\n\n```bash\n$
docker network ls --format \"{{.ID}}: {{.Driver}}\"\nafaaab448eb2: bridge\nd1584f8dc718:
host\n391df270dc66: null\n```"
Go template are listed below:\n\nPlaceholder | Description\n-------------|------------------------------------------------------------------------------------------\n`.ID`
\ | Network ID\n`.Name` | Network name\n`.Driver` | Network driver\n`.Scope`
\ | Network scope (local, global)\n`.IPv6` | Whether IPv6 is enabled on
the network or not.\n`.Internal` | Whether the network is internal or not.\n`.Labels`
\ | All labels assigned to the network.\n`.Label` | Value of a specific label
for this network. For example `{{.Label \"project.version\"}}`\n`.CreatedAt` | Time
when the network was created\n\nWhen using the `--format` option, the `network ls`
command will either\noutput the data exactly as the template declares or, when using
the\n`table` directive, includes column headers as well.\n\nThe following example
uses a template without headers and outputs the\n`ID` and `Driver` entries separated
by a colon for all networks:\n\n```bash\n$ docker network ls --format \"{{.ID}}:
{{.Driver}}\"\nafaaab448eb2: bridge\nd1584f8dc718: host\n391df270dc66: null\n```"

View File

@ -7,6 +7,8 @@ usage: docker network prune [OPTIONS]
pname: docker network
plink: docker_network.yaml
options:
- option: filter
description: Provide filter values (e.g. 'until=<timestamp>')
- option: force
shorthand: f
default_value: "false"

View File

@ -15,7 +15,7 @@ options:
description: Format the output using the given Go template
- option: pretty
default_value: "false"
description: Print the information in a human friendly format.
description: Print the information in a human friendly format
examples: |-
### Inspect a node

View File

@ -10,12 +10,18 @@ options:
- option: filter
shorthand: f
description: Filter output based on conditions provided
- option: format
description: Pretty-print tasks using a Go template
- option: no-resolve
default_value: "false"
description: Do not map IDs to Names
- option: no-trunc
default_value: "false"
description: Do not truncate output
- option: quiet
shorthand: q
default_value: "false"
description: Only display task IDs
examples: |-
```bash
$ docker node ps swarm-manager1
@ -85,5 +91,37 @@ examples: |-
#### desired-state
The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
### Formatting
The formatting options (`--format`) pretty-prints tasks output
using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
----------------|------------------------------------------------------------------------------------------
`.Name` | Task name
`.Image` | Task image
`.Node` | Node ID
`.DesiredState` | Desired state of the task (`running`, `shutdown`, or `accepted`)
`.CurrentState` | Current state of the task
`.Error` | Error
`.Ports` | Task published ports
When using the `--format` option, the `node ps` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`Name` and `Image` entries separated by a colon for all tasks:
```bash
$ docker node ps --format "{{.Name}}: {{.Image}}"
top.1: busybox
top.2: busybox
top.3: busybox
```

View File

@ -6,7 +6,7 @@ pname: docker node
plink: docker_node.yaml
options:
- option: availability
description: Availability of the node (active/pause/drain)
description: Availability of the node ("active"|"pause"|"drain")
- option: label-add
default_value: '[]'
description: Add or update a node label (key=value)
@ -14,7 +14,7 @@ options:
default_value: '[]'
description: Remove a node label if exists
- option: role
description: Role of the node (worker/manager)
description: Role of the node ("worker"|"manager")
examples: |-
### Add label metadata to a node

View File

@ -126,8 +126,10 @@ examples: |-
### Formatting the output
```bash
{% raw %}
$ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21
{% endraw %}
```

View File

@ -4,13 +4,24 @@ short: List plugins
long: |-
Lists all the plugins that are currently installed. You can install plugins
using the [`docker plugin install`](plugin_install.md) command.
You can also filter using the `-f` or `--filter` flag.
Refer to the [filtering](#filtering) section for more information about available filter options.
usage: docker plugin ls [OPTIONS]
pname: docker plugin
plink: docker_plugin.yaml
options:
- option: filter
shorthand: f
description: Provide filter values (e.g. 'enabled=true')
- option: format
description: Pretty-print plugins using a Go template
- option: no-trunc
default_value: "false"
description: Don't truncate output
- option: quiet
shorthand: q
default_value: "false"
description: Only display plugin IDs
examples: |-
```bash
$ docker plugin ls
@ -73,8 +84,10 @@ examples: |-
`ID` and `Name` entries separated by a colon for all plugins:
```bash
{% raw %}
$ docker plugin ls --format "{{.ID}}: {{.Name}}"
4be01827a72e: tiborvass/no-remove
{% endraw %}
```

View File

@ -12,7 +12,7 @@ plink: docker_plugin.yaml
options:
- option: disable-content-trust
default_value: "true"
description: Skip image verification
description: Skip image signing
examples: |-
The following example shows how to push a sample `user/plugin`.

View File

@ -18,6 +18,7 @@ examples: |-
`sample-volume-plugin` plugin.
```bash
{% raw %}
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
[DEBUG=0]
@ -26,6 +27,7 @@ examples: |-
$ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin
[DEBUG=1]
{% endraw %}
```
### Change the source of a mount
@ -34,6 +36,7 @@ examples: |-
the `myplugin` plugin.
```bash
{% raw %}
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
/foo
@ -41,6 +44,7 @@ examples: |-
$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
/bar
{% endraw %}
```
> **Note**: Since only `source` is settable in `mymount`,
@ -52,6 +56,7 @@ examples: |-
the `myplugin` plugin.
```bash
{% raw %}
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
/dev/foo
@ -59,6 +64,7 @@ examples: |-
$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
/dev/bar
{% endraw %}
```
> **Note**: Since only `path` is settable in `mydevice`,
@ -69,6 +75,7 @@ examples: |-
The following example change the source of the args on the `myplugin` plugin.
```bash
{% raw %}
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
["foo", "bar"]
@ -76,5 +83,6 @@ examples: |-
$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
["foo", "bar", "baz"]
{% endraw %}
```

View File

@ -78,6 +78,8 @@ examples: |-
* volume (volume name or mount point) - filters containers that mount volumes.
* network (network id or name) - filters containers connected to the provided network
* health (starting|healthy|unhealthy|none) - filters containers based on healthcheck status
* publish=(container's published port) - filters published ports by containers
* expose=(container's exposed port) - filters exposed ports by containers
#### label

View File

@ -18,7 +18,7 @@ plink: docker.yaml
options:
- option: disable-content-trust
default_value: "true"
description: Skip image verification
description: Skip image signing
examples: |-
### Push a new image to a registry

View File

@ -1,6 +1,17 @@
command: docker run
short: Run a command in a new container
long: Run a command in a new container
long: |-
The `docker run` command first `creates` a writeable container layer over the
specified image, and then `starts` it using the specified command. That is,
`docker run` is equivalent to the API `/containers/create` then
`/containers/(id)/start`. A stopped container can be restarted with all its
previous changes intact using `docker start`. See `docker ps -a` to view a list
of all containers.
The `docker run` command can be used in combination with `docker commit` to
[*change the command that a container runs*](commit.md). There is additional detailed information about `docker run` in the [Docker run reference](../run.md).
For information on connecting a container to a network, see the ["*Docker network overview*"](https://docs.docker.com/engine/userguide/networking/).
usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
pname: docker
plink: docker.yaml
@ -69,6 +80,9 @@ options:
- option: device
default_value: '[]'
description: Add a host device to the container
- option: device-cgroup-rule
default_value: '[]'
description: Add a rule to the cgroup allowed devices list
- option: device-read-bps
default_value: '[]'
description: Limit read rate (bytes per second) from a device
@ -140,20 +154,22 @@ options:
default_value: "false"
description: Keep STDIN open even if not attached
- option: io-maxbandwidth
default_value: "0"
description: |
Maximum IO bandwidth limit for the system drive (Windows only)
- option: io-maxiops
default_value: "0"
description: Maximum IOps limit for the system drive (Windows only)
- option: ip
description: Container IPv4 address (e.g. 172.30.100.104)
description: IPv4 address (e.g., 172.30.100.104)
- option: ip6
description: Container IPv6 address (e.g. 2001:db8::33)
description: IPv6 address (e.g., 2001:db8::33)
- option: ipc
description: IPC namespace to use
- option: isolation
description: Container isolation technology
- option: kernel-memory
default_value: "0"
description: Kernel memory limit
- option: label
shorthand: l
@ -174,13 +190,16 @@ options:
default_value: '[]'
description: Log driver options
- option: mac-address
description: Container MAC address (e.g. 92:d0:c6:0a:29:33)
description: Container MAC address (e.g., 92:d0:c6:0a:29:33)
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-reservation
default_value: "0"
description: Memory soft limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: memory-swappiness
@ -240,13 +259,14 @@ options:
default_value: '[]'
description: Security Options
- option: shm-size
description: Size of /dev/shm, default value is 64MB
default_value: "0"
description: Size of /dev/shm
- option: sig-proxy
default_value: "true"
description: Proxy received signals to the process
- option: stop-signal
default_value: SIGTERM
description: Signal to stop a container, SIGTERM by default
description: Signal to stop a container
- option: stop-timeout
default_value: "0"
description: Timeout (in seconds) to stop a container
@ -830,38 +850,45 @@ examples: |-
### Specify isolation technology for container (--isolation)
This option is useful in situations where you are running Docker containers on
Microsoft Windows. The `--isolation <value>` option sets a container's isolation
technology. On Linux, the only supported is the `default` option which uses
Windows. The `--isolation <value>` option sets a container's isolation technology.
On Linux, the only supported is the `default` option which uses
Linux namespaces. These two commands are equivalent on Linux:
```
```bash
$ docker run -d busybox top
$ docker run -d --isolation default busybox top
```
On Microsoft Windows, can take any of these values:
On Windows, `--isolation` can take one of these values:
| Value | Description |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `default` | Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. |
| `process` | Namespace isolation only. |
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
| Value | Description |
|-----------|--------------------------------------------------------------------------------------------|
| `default` | Use the value specified by the Docker daemon's `--exec-opt` or system default (see below). |
| `process` | Shared-kernel namespace isolation (not supported on Windows client operating systems). |
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
On Windows, the default isolation for client is `hyperv`, and for server is
`process`. Therefore when running on Windows server without a `daemon` option
set, these two commands are equivalent:
```
$ docker run -d --isolation default busybox top
$ docker run -d --isolation process busybox top
The default isolation on Windows server operating systems is `process`. The default (and only supported)
isolation on Windows client operating systems is `hyperv`. An attempt to start a container on a client
operating system with `--isolation process` will fail.
On Windows server, assuming the default configuration, these commands are equivalent
and result in `process` isolation:
```PowerShell
PS C:\> docker run -d microsoft/nanoserver powershell echo process
PS C:\> docker run -d --isolation default microsoft/nanoserver powershell echo process
PS C:\> docker run -d --isolation process microsoft/nanoserver powershell echo process
```
If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`,
if running on Windows server, any of these commands also result in `hyperv` isolation:
If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`, or
are running against a Windows client-based daemon, these commands are equivalent and
result in `hyperv` isolation:
```
$ docker run -d --isolation default busybox top
$ docker run -d --isolation hyperv busybox top
```PowerShell
PS C:\> docker run -d microsoft/nanoserver powershell echo hyperv
PS C:\> docker run -d --isolation default microsoft/nanoserver powershell echo hyperv
PS C:\> docker run -d --isolation hyperv microsoft/nanoserver powershell echo hyperv
```
### Configure namespaced kernel parameters (sysctls) at runtime

View File

@ -23,6 +23,7 @@ options:
default_value: '[]'
description: Set custom DNS search domains
- option: endpoint-mode
default_value: vip
description: Endpoint mode (vip or dnsrr)
- option: env
shorthand: e
@ -56,7 +57,7 @@ options:
default_value: "0.000"
description: Limit CPUs
- option: limit-memory
default_value: 0 B
default_value: "0"
description: Limit Memory
- option: log-driver
description: Logging driver for service
@ -76,30 +77,54 @@ options:
- option: no-healthcheck
default_value: "false"
description: Disable any container-specified HEALTHCHECK
- option: placement-pref
description: Add a placement preference
- option: publish
shorthand: p
description: Publish a port as a node port
- option: read-only
default_value: "false"
description: Mount the container's root filesystem as read only
- option: replicas
description: Number of tasks
- option: reserve-cpu
default_value: "0.000"
description: Reserve CPUs
- option: reserve-memory
default_value: 0 B
default_value: "0"
description: Reserve Memory
- option: restart-condition
description: Restart when condition is met (none, on-failure, or any)
description: Restart when condition is met ("none"|"on-failure"|"any")
- option: restart-delay
description: Delay between restart attempts (ns|us|ms|s|m|h)
- option: restart-max-attempts
description: Maximum number of restarts before giving up
- option: restart-window
description: Window used to evaluate the restart policy (ns|us|ms|s|m|h)
- option: rollback-delay
default_value: 0s
description: Delay between task rollbacks (ns|us|ms|s|m|h) (default 0s)
- option: rollback-failure-action
default_value: pause
description: Action on rollback failure ("pause"|"continue")
- option: rollback-max-failure-ratio
default_value: "0"
description: Failure rate to tolerate during a rollback
- option: rollback-monitor
default_value: 0s
description: |
Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default 0s)
- option: rollback-parallelism
default_value: "1"
description: |
Maximum number of tasks rolled back simultaneously (0 to roll back all at once)
- option: secret
description: Specify secrets to expose to the service
- option: stop-grace-period
description: |
Time to wait before force killing a container (ns|us|ms|s|m|h)
- option: stop-signal
description: Signal to stop the container
- option: tty
shorthand: t
default_value: "false"
@ -109,7 +134,7 @@ options:
description: Delay between updates (ns|us|ms|s|m|h) (default 0s)
- option: update-failure-action
default_value: pause
description: Action on update failure (pause|continue)
description: Action on update failure ("pause"|"continue"|"rollback")
- option: update-max-failure-ratio
default_value: "0"
description: Failure rate to tolerate during an update
@ -366,9 +391,22 @@ examples: |-
</ul></p>
</td>
</tr>
<tr>
<td><b>consistency</b></td>
<td></td>
<td>
<p>The consistency requirements for the mount; one of
<ul>
<li><tt>default</tt>: Equivalent to <tt>consistent</tt>.</li>
<li><tt>consistent</tt>: Full consistency. The container runtime and the host maintain an identical view of the mount at all times.</li>
<li><tt>cached</tt>: The host's view of the mount is authoritative. There may be delays before updates made on the host are visible within a container.</li>
<li><tt>delegated</tt>: The container runtime's view of the mount is authoritative. There may be delays before updates made in a container are are visible on the host.</li>
</ul>
</p>
</td>
</tr>
</table>
#### Bind Propagation
Bind propagation refers to whether or not mounts created within a given
@ -636,6 +674,77 @@ examples: |-
redis:3.0.6
```
### Specify service placement preferences (--placement-pref)
You can set up the service to divide tasks evenly over different categories of
nodes. One example of where this can be useful is to balance tasks over a set
of datacenters or availability zones. The example below illustrates this:
```bash
$ docker service create \
--replicas 9 \
--name redis_2 \
--placement-pref 'spread=node.labels.datacenter' \
redis:3.0.6
```
This uses `--placement-pref` with a `spread` strategy (currently the only
supported strategy) to spread tasks evenly over the values of the `datacenter`
node label. In this example, we assume that every node has a `datacenter` node
label attached to it. If there are three different values of this label among
nodes in the swarm, one third of the tasks will be placed on the nodes
associated with each value. This is true even if there are more nodes with one
value than another. For example, consider the following set of nodes:
- Three nodes with `node.labels.datacenter=east`
- Two nodes with `node.labels.datacenter=south`
- One node with `node.labels.datacenter=west`
Since we are spreading over the values of the `datacenter` label and the
service has 9 replicas, 3 replicas will end up in each datacenter. There are
three nodes associated with the value `east`, so each one will get one of the
three replicas reserved for this value. There are two nodes with the value
`south`, and the three replicas for this value will be divided between them,
with one receiving two replicas and another receiving just one. Finally, `west`
has a single node that will get all three replicas reserved for `west`.
If the nodes in one category (for example, those with
`node.labels.datacenter=south`) can't handle their fair share of tasks due to
constraints or resource limitations, the extra tasks will be assigned to other
nodes instead, if possible.
Both engine labels and node labels are supported by placement preferences. The
example above uses a node label, because the label is referenced with
`node.labels.datacenter`. To spread over the values of an engine label, use
`--placement-pref spread=engine.labels.<labelname>`.
It is possible to add multiple placement preferences to a service. This
establishes a hierarchy of preferences, so that tasks are first divided over
one category, and then further divided over additional categories. One example
of where this may be useful is dividing tasks fairly between datacenters, and
then splitting the tasks within each datacenter over a choice of racks. To add
multiple placement preferences, specify the `--placement-pref` flag multiple
times. The order is significant, and the placement preferences will be applied
in the order given when making scheduling decisions.
The following example sets up a service with multiple placement preferences.
Tasks are spread first over the various datacenters, and then over racks
(as indicated by the respective labels):
```bash
$ docker service create \
--replicas 9 \
--name redis_2 \
--placement-pref 'spread=node.labels.datacenter' \
--placement-pref 'spread=node.labels.rack' \
redis:3.0.6
```
When updating a service with `docker service update`, `--placement-pref-add`
appends a new placement preference after all existing placement preferences.
`--placement-pref-rm` removes an existing placement preference that matches the
argument.
### Attach a service to an existing network (--network)
You can use overlay networks to connect one or more services within the swarm.
@ -789,5 +898,6 @@ examples: |-
$ docker inspect --format="{{.Config.Hostname}}" hosttempl.1.wo41w8hg8qanxwjwsg4kxpprj
x3ti0erg11rjpg64m75kej2mz-hosttempl
{% endraw %}
```

View File

@ -18,7 +18,7 @@ options:
description: Format the output using the given Go template
- option: pretty
default_value: "false"
description: Print the information in a human friendly format.
description: Print the information in a human friendly format
examples: "### Inspect a service by name or ID\n\nYou can inspect a service, either
by its *name*, or *ID*\n\nFor example, given the following service;\n\n```bash\n$
docker service ls\nID NAME MODE REPLICAS IMAGE\ndmu1ept4cxcf
@ -43,11 +43,11 @@ examples: "### Inspect a service by name or ID\n\nYou can inspect a service, eit
of the default\nJSON output, by using the `--pretty` option:\n\n```bash\n$ docker
service inspect --pretty frontend\n\nID:\t\tc8wgl7q4ndfd52ni6qftkvnnp\nName:\t\tfrontend\nLabels:\n
- org.example.projectname=demo-app\nService Mode:\tREPLICATED\n Replicas:\t\t5\nPlacement:\nUpdateConfig:\n
Parallelism:\t0\nContainerSpec:\n Image:\t\tnginx:alpine\nResources:\nEndpoint Mode:
\ vip\nPorts:\n Name =\n Protocol = tcp\n TargetPort = 443\n PublishedPort = 4443\n```\n\nYou
can also use `--format pretty` for the same effect.\n\n\n#### Find the number of
tasks running as part of a service\n\nThe `--format` option can be used to obtain
specific information about a\nservice. For example, the following command outputs
the number of replicas\nof the \"redis\" service.\n\n```bash\n$ docker service inspect
--format='{{.Spec.Mode.Replicated.Replicas}}' redis\n\n10\n```"
Parallelism:\t0\n On failure:\tpause\n Max failure ratio:\t0\nContainerSpec:\n Image:\t\tnginx:alpine\nResources:\nNetworks:\tnet1\nEndpoint
Mode: vip\nPorts:\n PublishedPort = 4443\n Protocol = tcp\n TargetPort = 443\n
\ PublishMode = ingress\n```\n\nYou can also use `--format pretty` for the same
effect.\n\n\n#### Find the number of tasks running as part of a service\n\nThe `--format`
option can be used to obtain specific information about a\nservice. For example,
the following command outputs the number of replicas\nof the \"redis\" service.\n\n```bash\n$
docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis\n\n10\n```"

View File

@ -40,9 +40,6 @@ usage: docker service logs [OPTIONS] SERVICE
pname: docker service
plink: docker_service.yaml
options:
- option: details
default_value: "false"
description: Show extra details provided to logs
- option: follow
shorthand: f
default_value: "false"
@ -50,8 +47,15 @@ options:
- option: no-resolve
default_value: "false"
description: Do not map IDs to Names
- option: no-task-ids
default_value: "false"
description: Do not include task IDs
- option: no-trunc
default_value: "false"
description: Do not truncate output
- option: since
description: Show logs since timestamp
description: |
Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
- option: tail
default_value: all
description: Number of lines to show from the end of the logs

View File

@ -11,6 +11,8 @@ options:
- option: filter
shorthand: f
description: Filter output based on conditions provided
- option: format
description: Pretty-print services using a Go template
- option: quiet
shorthand: q
default_value: "false"
@ -89,5 +91,34 @@ examples: |-
0bcjwfh8ychr redis replicated 1/1 redis:3.0.6
```
<<<<<<< HEAD
### Formatting
The formatting options (`--format`) pretty-prints services output
using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
------------|------------------------------------------------------------------------------------------
`.ID` | Service ID
`.Name` | Service name
`.Mode` | Service mode (replicated, global)
`.Replicas` | Service replicas
`.Image` | Service image
When using the `--format` option, the `service ls` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
```bash
{% raw %}
$ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
0zmvwuiu3vue: replicated 10/10
fm6uf97exkul: global 5/5
{% endraw %}
```

View File

@ -1,15 +1,17 @@
command: docker service ps
short: List the tasks of a service
short: List the tasks of one or more services
long: |-
Lists the tasks that are running as part of the specified services. This command
has to be run targeting a manager node.
usage: docker service ps [OPTIONS] SERVICE
usage: docker service ps [OPTIONS] SERVICE [SERVICE...]
pname: docker service
plink: docker_service.yaml
options:
- option: filter
shorthand: f
description: Filter output based on conditions provided
- option: format
description: Pretty-print tasks using a Go template
- option: no-resolve
default_value: "false"
description: Do not map IDs to Names
@ -131,8 +133,39 @@ examples: |-
8eaxrb2fqpbn redis.10 redis:3.0.6 manager1 Running Running 8 seconds
```
#### desired-state
The `desired-state` filter can take the values `running`, `shutdown`, and `accepted`.
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
### Formatting
The formatting options (`--format`) pretty-prints tasks output
using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
----------------|------------------------------------------------------------------------------------------
`.ID` | Task ID
`.Name` | Task name
`.Image` | Task image
`.Node` | Node ID
`.DesiredState` | Desired state of the task (`running`, `shutdown`, or `accepted`)
`.CurrentState` | Current state of the task
`.Error` | Error
`.Ports` | Task published ports
When using the `--format` option, the `service ps` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`Name` and `Image` entries separated by a colon for all tasks:
```bash
$ docker service ps --format "{{.Name}}: {{.Image}}" top
top.1: busybox
top.2: busybox
top.3: busybox
```

View File

@ -47,6 +47,7 @@ options:
default_value: '[]'
description: Remove a DNS search domain
- option: endpoint-mode
default_value: vip
description: Endpoint mode (vip or dnsrr)
- option: env-add
default_value: '[]'
@ -93,7 +94,7 @@ options:
default_value: "0.000"
description: Limit CPUs
- option: limit-memory
default_value: 0 B
default_value: "0"
description: Limit Memory
- option: log-driver
description: Logging driver for service
@ -108,20 +109,27 @@ options:
- option: no-healthcheck
default_value: "false"
description: Disable any container-specified HEALTHCHECK
- option: placement-pref-add
description: Add a placement preference
- option: placement-pref-rm
description: Remove a placement preference
- option: publish-add
description: Add or update a published port
- option: publish-rm
description: Remove a published port by its target port
- option: read-only
default_value: "false"
description: Mount the container's root filesystem as read only
- option: replicas
description: Number of tasks
- option: reserve-cpu
default_value: "0.000"
description: Reserve CPUs
- option: reserve-memory
default_value: 0 B
default_value: "0"
description: Reserve Memory
- option: restart-condition
description: Restart when condition is met (none, on-failure, or any)
description: Restart when condition is met ("none"|"on-failure"|"any")
- option: restart-delay
description: Delay between restart attempts (ns|us|ms|s|m|h)
- option: restart-max-attempts
@ -131,6 +139,23 @@ options:
- option: rollback
default_value: "false"
description: Rollback to previous specification
- option: rollback-delay
default_value: 0s
description: Delay between task rollbacks (ns|us|ms|s|m|h) (default 0s)
- option: rollback-failure-action
default_value: pause
description: Action on rollback failure ("pause"|"continue")
- option: rollback-max-failure-ratio
default_value: "0"
description: Failure rate to tolerate during a rollback
- option: rollback-monitor
default_value: 0s
description: |
Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default 0s)
- option: rollback-parallelism
default_value: "1"
description: |
Maximum number of tasks rolled back simultaneously (0 to roll back all at once)
- option: secret-add
description: Add or update a secret on a service
- option: secret-rm
@ -139,6 +164,8 @@ options:
- option: stop-grace-period
description: |
Time to wait before force killing a container (ns|us|ms|s|m|h)
- option: stop-signal
description: Signal to stop the container
- option: tty
shorthand: t
default_value: "false"
@ -148,7 +175,7 @@ options:
description: Delay between updates (ns|us|ms|s|m|h) (default 0s)
- option: update-failure-action
default_value: pause
description: Action on update failure (pause|continue)
description: Action on update failure ("pause"|"continue"|"rollback")
- option: update-max-failure-ratio
default_value: "0"
description: Failure rate to tolerate during an update
@ -192,18 +219,29 @@ examples: "### Update a service\n\n```bash\n$ docker service update --limit-cpu
\ type=volume,source=other-volume,target=/somewhere-else \\\n myservice\n\nmyservice\n\n$
docker service update --mount-rm /somewhere myservice\n\nmyservice\n```\n\n### Rolling
back to the previous version of a service \n\nUse the `--rollback` option to roll
back to the previous version of the service. \n\nThis will revert the service to
back to the previous version of the service.\n\nThis will revert the service to
the configuration that was in place before the most recent `docker service update`
command.\n\nThe following example updates the number of replicas for the service
from 4 to 5, and then rolls back to the previous configuration.\n\n```bash\n$ docker
service update --replicas=5 web\n\nweb\n\n$ docker service ls\n\nID NAME
\ MODE REPLICAS IMAGE\n80bvrzp6vxf3 web replicated 0/5 nginx:alpine\n\n```\nRoll
back the `web` service... \n\n```bash\n$ docker service update --rollback web\n\nweb\n\n$
back the `web` service...\n\n```bash\n$ docker service update --rollback web\n\nweb\n\n$
docker service ls\n\nID NAME MODE REPLICAS IMAGE\n80bvrzp6vxf3
\ web replicated 0/4 nginx:alpine\n\n```\n\nOther options can be combined
with `--rollback` as well, for example, `--update-delay 0s` to execute the rollback
without a delay between tasks:\n\n```bash\n$ docker service update \\\n --rollback
\\\n --update-delay 0s\n web\n\nweb\n\n```\n\n### Add or remove secrets\n\nUse
\\\n --update-delay 0s\n web\n\nweb\n\n```\n\nServices can also be set up to roll
back to the previous version automatically\nwhen an update fails. To set up a service
for automatic rollback, use\n`--update-failure-action=rollback`. A rollback will
be triggered if the fraction\nof the tasks which failed to update successfully exceeds
the value given with\n`--update-max-failure-ratio`.\n\nThe rate, parallelism, and
other parameters of a rollback operation are\ndetermined by the values passed with
the following flags:\n\n- `--rollback-delay`\n- `--rollback-failure-action`\n- `--rollback-max-failure-ratio`\n-
`--rollback-monitor`\n- `--rollback-parallelism`\n\nFor example, a service set up
with `--update-parallelism 1 --rollback-parallelism 3`\nwill update one task at
a time during a normal update, but during a rollback, 3\ntasks at a time will get
rolled back. These rollback parameters are respected both\nduring automatic rollbacks
and for rollbacks initiated manually using `--rollback`.\n\n### Add or remove secrets\n\nUse
the `--secret-add` or `--secret-rm` options add or remove a service's\nsecrets.\n\nThe
following example adds a secret named `ssh-2` and removes `ssh-1`:\n\n```bash\n$
docker service update \\\n --secret-add source=ssh-2,target=ssh-2 \\\n --secret-rm

View File

@ -10,15 +10,34 @@ options:
- option: filter
shorthand: f
description: Filter output based on conditions provided
- option: format
description: Pretty-print tasks using a Go template
- option: no-resolve
default_value: "false"
description: Do not map IDs to Names
- option: no-trunc
default_value: "false"
description: Do not truncate output
- option: quiet
shorthand: q
default_value: "false"
description: Only display task IDs
examples: |-
### List the tasks that are part of a stack
The following command shows all the tasks that are part of the `voting` stack:
```bash
$ docker stack ps
$ docker stack ps voting
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
xim5bcqtgk1b voting_worker.1 dockersamples/examplevotingapp_worker:latest node2 Running Running 2 minutes ago
q7yik0ks1in6 voting_result.1 dockersamples/examplevotingapp_result:before node1 Running Running 2 minutes ago
rx5yo0866nfx voting_vote.1 dockersamples/examplevotingapp_vote:before node3 Running Running 2 minutes ago
tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 2 minutes ago
w48spazhbmxc voting_redis.1 redis:alpine node2 Running Running 3 minutes ago
6jj1m02freg1 voting_visualizer.1 dockersamples/visualizer:stable node1 Running Running 2 minutes ago
kqgdmededccb voting_vote.2 dockersamples/examplevotingapp_vote:before node2 Running Running 2 minutes ago
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 3 minutes ago
```
### Filtering
@ -30,7 +49,163 @@ examples: |-
The currently supported filters are:
* id
* name
* desired-stat
* [id](#id)
* [name](#name)
* [node](#node)
* [desired-state](#desired-state)
#### id
The `id` filter matches on all or a prefix of a task's ID.
```bash
$ docker stack ps -f "id=t" voting
ID NAME IMAGE NODE DESIRED STATE CURRENTSTATE ERROR PORTS
tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 14 minutes ago
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 14 minutes ago
```
#### name
The `name` filter matches on task names.
```bash
$ docker stack ps -f "name=voting_redis" voting
ID NAME IMAGE NODE DESIRED STATE CURRENTSTATE ERROR PORTS
w48spazhbmxc voting_redis.1 redis:alpine node2 Running Running 17 minutes ago
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 17 minutes ago
```
#### node
The `node` filter matches on a node name or a node ID.
```bash
$ docker stack ps -f "node=node1" voting
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
q7yik0ks1in6 voting_result.1 dockersamples/examplevotingapp_result:before node1 Running Running 18 minutes ago
tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 18 minutes ago
6jj1m02freg1 voting_visualizer.1 dockersamples/visualizer:stable node1 Running Running 18 minutes ago
```
#### desired-state
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
```bash
$ docker stack ps -f "desired-state=running" voting
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
xim5bcqtgk1b voting_worker.1 dockersamples/examplevotingapp_worker:latest node2 Running Running 21 minutes ago
q7yik0ks1in6 voting_result.1 dockersamples/examplevotingapp_result:before node1 Running Running 21 minutes ago
rx5yo0866nfx voting_vote.1 dockersamples/examplevotingapp_vote:before node3 Running Running 21 minutes ago
tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 21 minutes ago
w48spazhbmxc voting_redis.1 redis:alpine node2 Running Running 21 minutes ago
6jj1m02freg1 voting_visualizer.1 dockersamples/visualizer:stable node1 Running Running 21 minutes ago
kqgdmededccb voting_vote.2 dockersamples/examplevotingapp_vote:before node2 Running Running 21 minutes ago
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 21 minutes ago
```
### Formatting
The formatting options (`--format`) pretty-prints tasks output using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
----------------|------------------------------------------------------------------------------------------
`.ID` | Task ID
`.Name` | Task name
`.Image` | Task image
`.Node` | Node ID
`.DesiredState` | Desired state of the task (`running`, `shutdown`, or `accepted`)
`.CurrentState` | Current state of the task
`.Error` | Error
`.Ports` | Task published ports
When using the `--format` option, the `stack ps` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`Name` and `Image` entries separated by a colon for all tasks:
```bash
$ docker stack ps --format "{{.Name}}: {{.Image}}" voting
voting_worker.1: dockersamples/examplevotingapp_worker:latest
voting_result.1: dockersamples/examplevotingapp_result:before
voting_vote.1: dockersamples/examplevotingapp_vote:before
voting_db.1: postgres:9.4
voting_redis.1: redis:alpine
voting_visualizer.1: dockersamples/visualizer:stable
voting_vote.2: dockersamples/examplevotingapp_vote:before
voting_redis.2: redis:alpine
```
### Do not map IDs to Names
The `--no-resolve` option shows IDs for task name, without mapping IDs to Names.
```bash
$ docker stack ps --no-resolve voting
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
xim5bcqtgk1b 10z9fjfqzsxnezo4hb81p8mqg.1 dockersamples/examplevotingapp_worker:latest qaqt4nrzo775jrx6detglho01 Running Running 30 minutes ago
q7yik0ks1in6 hbxltua1na7mgqjnidldv5m65.1 dockersamples/examplevotingapp_result:before mxpaef1tlh23s052erw88a4w5 Running Running 30 minutes ago
rx5yo0866nfx qyprtqw1g5nrki557i974ou1d.1 dockersamples/examplevotingapp_vote:before kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago
tz6j82jnwrx7 122f0xxngg17z52be7xspa72x.1 postgres:9.4 mxpaef1tlh23s052erw88a4w5 Running Running 31 minutes ago
w48spazhbmxc tg61x8myx563ueo3urmn1ic6m.1 redis:alpine qaqt4nrzo775jrx6detglho01 Running Running 31 minutes ago
6jj1m02freg1 8cqlyi444kzd3panjb7edh26v.1 dockersamples/visualizer:stable mxpaef1tlh23s052erw88a4w5 Running Running 31 minutes ago
kqgdmededccb qyprtqw1g5nrki557i974ou1d.2 dockersamples/examplevotingapp_vote:before qaqt4nrzo775jrx6detglho01 Running Running 31 minutes ago
t72q3z038jeh tg61x8myx563ueo3urmn1ic6m.2 redis:alpine kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago
```
### Do not truncate output
When deploying a service, docker resolves the digest for the service's
image, and pins the service to that digest. The digest is not shown by
default, but is printed if `--no-trunc` is used. The `--no-trunc` option
also shows the non-truncated task IDs, and error-messages, as can be seen below:
```bash
$ docker stack ps --no-trunc voting
ID NAME IMAGE NODE DESIRED STATE CURREN STATE ERROR PORTS
xim5bcqtgk1bxqz91jzo4a1s5 voting_worker.1 dockersamples/examplevotingapp_worker:latest@sha256:3e4ddf59c15f432280a2c0679c4fc5a2ee5a797023c8ef0d3baf7b1385e9fed node2 Running Runnin 32 minutes ago
q7yik0ks1in6kv32gg6y6yjf7 voting_result.1 dockersamples/examplevotingapp_result:before@sha256:83b56996e930c292a6ae5187fda84dd6568a19d97cdb933720be15c757b7463 node1 Running Runnin 32 minutes ago
rx5yo0866nfxc58zf4irsss6n voting_vote.1 dockersamples/examplevotingapp_vote:before@sha256:8e64b182c87de902f2b72321c89b4af4e2b942d76d0b772532ff27ec4c6ebf6 node3 Running Runnin 32 minutes ago
tz6j82jnwrx7n2offljp3mn03 voting_db.1 postgres:9.4@sha256:6046af499eae34d2074c0b53f9a8b404716d415e4a03e68bc1d2f8064f2b027 node1 Running Runnin 32 minutes ago
w48spazhbmxcmbjfi54gs7x90 voting_redis.1 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node2 Running Runnin 32 minutes ago
6jj1m02freg1n3z9n1evrzsbl voting_visualizer.1 dockersamples/visualizer:stable@sha256:f924ad66c8e94b10baaf7bdb9cd491ef4e982a1d048a56a17e02bf5945401e5 node1 Running Runnin 32 minutes ago
kqgdmededccbhz2wuc0e9hx7g voting_vote.2 dockersamples/examplevotingapp_vote:before@sha256:8e64b182c87de902f2b72321c89b4af4e2b942d76d0b772532ff27ec4c6ebf6 node2 Running Runnin 32 minutes ago
t72q3z038jehe1wbh9gdum076 voting_redis.2 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node3 Running Runnin 32 minutes ago
```
### Only display task IDs
The `-q ` or `--quiet` option only shows IDs of the tasks in the stack.
This example outputs all task IDs of the "voting" stack;
```bash
$ docker stack ps -q voting
xim5bcqtgk1b
q7yik0ks1in6
rx5yo0866nfx
tz6j82jnwrx7
w48spazhbmxc
6jj1m02freg1
kqgdmededccb
t72q3z038jeh
```
This option can be used to perform batch operations. For example, you can use
the task IDs as input for other commands, such as `docker inspect`. The
following example inspects all tasks of the "voting" stack;
```bash
$ docker inspect $(docker stack ps -q voting)
[
{
"ID": "xim5bcqtgk1b1gk0krq1",
"Version": {
(...)
```

View File

@ -10,6 +10,8 @@ options:
- option: filter
shorthand: f
description: Filter output based on conditions provided
- option: format
description: Pretty-print services using a Go template
- option: quiet
shorthand: q
default_value: "false"
@ -70,9 +72,11 @@ examples: |-
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
```bash
{% raw %}
$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
0zmvwuiu3vue: replicated 10/10
fm6uf97exkul: global 5/5
{% endraw %}
```

View File

@ -37,6 +37,19 @@ examples: |-
fervent_panini 0.02% 11.08 MiB/1.045 GiB 1.06% 648 B/648 B
```
Running `docker stats` with customized format on all (Running and Stopped) containers.
```bash
$ docker stats --all --format "table {{.ID}}\t{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}"
CONTAINER ID NAME CPU % MEM USAGE / LIMIT
c9dfa83f0317f87637d5b7e67aa4223337d947215c5a9947e697e4f7d3e0f834 ecstatic_noether 0.00% 56KiB / 15.57GiB
8f92d01cf3b29b4f5fca4cd33d907e05def7af5a3684711b20a2369d211ec67f stoic_goodall 0.07% 32.86MiB / 15.57GiB
38dd23dba00f307d53d040c1d18a91361bbdcccbf592315927d56cf13d8b7343 drunk_visvesvaraya 0.00% 0B / 0B
5a8b07ec4cc52823f3cbfdb964018623c1ba307bce2c057ccdbde5f4f6990833 big_heisenberg 0.00% 0B / 0B
```
`drunk_visvesvaraya` and `big_heisenberg` are stopped containers in the above example.
Running `docker stats` on all running containers against a Windows daemon.
```powershell
@ -90,22 +103,26 @@ examples: |-
`Container` and `CPUPerc` entries separated by a colon for all images:
```bash
{% raw %}
$ docker stats --format "{{.Container}}: {{.CPUPerc}}"
09d3bb5b1604: 6.61%
9db7aa4d986d: 9.19%
3f214c61ad1d: 0.00%
{% endraw %}
```
To list all containers statistics with their name, CPU percentage and memory
usage in a table format you can use:
```bash
{% raw %}
$ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
CONTAINER CPU % PRIV WORKING SET
1285939c1fd3 0.07% 796 KiB / 64 MiB
9c76f7834ae2 0.07% 2.746 MiB / 64 MiB
d1ea048f04e4 0.03% 4.583 MiB / 64 MiB
{% endraw %}
```

View File

@ -13,6 +13,9 @@ options:
default_value: "false"
description: |
Enable manager autolocking (requiring an unlock key to start a stopped manager)
- option: availability
default_value: active
description: Availability of the node ("active"|"pause"|"drain")
- option: cert-expiry
default_value: 2160h0m0s
description: Validity period for node certificates (ns|us|ms|s|m|h)

View File

@ -10,6 +10,9 @@ plink: docker_swarm.yaml
options:
- option: advertise-addr
description: 'Advertised address (format: <ip|interface>[:port])'
- option: availability
default_value: active
description: Availability of the node ("active"|"pause"|"drain")
- option: listen-addr
default_value: 0.0.0.0:2377
description: 'Listen address (format: <ip|interface>[:port])'
@ -77,5 +80,14 @@ examples: |-
### `--token string`
Secret value required for nodes to join the swar
Secret value required for nodes to join the swarm
### `--availability`
This flag specifies the availability of the node at the time the node joins a master.
Possible availability values are `active`, `pause`, or `drain`.
This flag is useful in certain situations. For example, a cluster may want to have
dedicated manager nodes that are not served as worker nodes. This could be achieved
by passing `--availability=drain` to `docker swarm join`.

View File

@ -10,6 +10,8 @@ options:
shorthand: a
default_value: "false"
description: Remove all unused images not just dangling ones
- option: filter
description: Provide filter values (e.g. 'until=<timestamp>')
- option: force
shorthand: f
default_value: "false"

View File

@ -40,13 +40,17 @@ options:
- option: cpuset-mems
description: MEMs in which to allow execution (0-3, 0,1)
- option: kernel-memory
default_value: "0"
description: Kernel memory limit
- option: memory
shorthand: m
default_value: "0"
description: Memory limit
- option: memory-reservation
default_value: "0"
description: Memory soft limit
- option: memory-swap
default_value: "0"
description: |
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
- option: restart

View File

@ -63,9 +63,9 @@ examples: |-
#### driver
The `driver` filter matches on all or part of a volume's driver name.
The `driver` filter matches volumes based on their driver.
The following filter matches all volumes with a driver name containing the `local` string.
The following example matches volumes that are created with the `local` driver:
```bash
$ docker volume ls -f driver=local
@ -160,10 +160,12 @@ examples: |-
`Name` and `Driver` entries separated by a colon for all volumes:
```bash
{% raw %}
$ docker volume ls --format "{{.Name}}: {{.Driver}}"
vol1: local
vol2: local
vol3: local
{% endraw %}
```

View File

@ -61,7 +61,7 @@ examples: |-
```bash
$ docker ps
ICONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky
197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton

View File

@ -1,6 +1,6 @@
command: docker container
short: Manage containers
long: Manage containers
long: Manage containers.
usage: docker container
pname: docker
plink: docker.yaml

View File

@ -23,68 +23,3 @@ examples: |-
Total reclaimed space: 212 B
```
### Filtering
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
The currently supported filters are:
* until (`<timestamp>`) - only remove containers created before given timestamp
The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
timezone on the daemon will be used if you do not provide either a `Z` or a
`+-00:00` timezone offset at the end of the timestamp. When providing Unix
timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
fraction of a second no more than nine digits long.
The following removes containers created more than 5 minutes ago:
```bash
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 41 seconds ago
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 12 minutes ago
$ docker container prune --force --filter "until=5m"
Deleted Containers:
53a9bc23a5168b6caa2bfbefddf1b30f93c7ad57f3dec271fd32707497cb9369
Total reclaimed space: 25 B
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 44 seconds ago
```
The following removes containers created before `2017-01-04T13:10:00`:
```bash
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 7 minutes ago
4a75091a6d61 busybox "sh" 2017-01-04 13:09:53 -0800 PST Exited (0) 9 minutes ago
$ docker container prune --force --filter "until=2017-01-04T13:10:00"
Deleted Containers:
4a75091a6d618526fcd8b33ccd6e5928ca2a64415466f768a6180004b0c72c6c
Total reclaimed space: 27 B
$ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}'
CONTAINER ID IMAGE COMMAND CREATED AT STATUS
53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 9 minutes ago
```

View File

@ -1,6 +1,6 @@
command: docker image
short: Manage images
long: Manage images
long: Manage images.
usage: docker image
pname: docker
plink: docker.yaml

View File

@ -50,91 +50,3 @@ examples: |2-
Total reclaimed space: 16.43 MB
```
### Filtering
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
The currently supported filters are:
* until (`<timestamp>`) - only remove images created before given timestamp
The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
timezone on the daemon will be used if you do not provide either a `Z` or a
`+-00:00` timezone offset at the end of the timestamp. When providing Unix
timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
fraction of a second no more than nine digits long.
The following removes images created before `2017-01-04T00:00:00`:
```bash
$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
REPOSITORY TAG IMAGE ID CREATED AT SIZE
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
alpine latest 88e169ea8f46 2016-12-27 10:17:25 -0800 PST 3.98 MB
busybox latest e02e811dd08f 2016-10-07 14:03:58 -0700 PDT 1.09 MB
$ docker image prune -a --force --filter "until=2017-01-04T00:00:00"
Deleted Images:
untagged: alpine:latest
untagged: alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
untagged: busybox:latest
untagged: busybox@sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
deleted: sha256:e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba
deleted: sha256:e88b3f82283bc59d5e0df427c824e9f95557e661fcb0ea15fb0fb6f97760f9d9
Total reclaimed space: 1.093 MB
$ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}'
REPOSITORY TAG IMAGE ID CREATED AT SIZE
foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB
```
The following removes images created more than 10 days (`240h`) ago:
```bash
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
foo latest 2f287ac753da 14 seconds ago 3.98 MB
alpine latest 88e169ea8f46 8 days ago 3.98 MB
debian jessie 7b0a06c805e8 2 months ago 123 MB
busybox latest e02e811dd08f 2 months ago 1.09 MB
golang 1.7.0 138c2e655421 4 months ago 670 MB
$ docker image prune -a --force --filter "until=240h"
Deleted Images:
untagged: golang:1.7.0
untagged: golang@sha256:6765038c2b8f407fd6e3ecea043b44580c229ccfa2a13f6d85866cf2b4a9628e
deleted: sha256:138c2e6554219de65614d88c15521bfb2da674cbb0bf840de161f89ff4264b96
deleted: sha256:ec353c2e1a673f456c4b78906d0d77f9d9456cfb5229b78c6a960bfb7496b76a
deleted: sha256:fe22765feaf3907526b4921c73ea6643ff9e334497c9b7e177972cf22f68ee93
deleted: sha256:ff845959c80148421a5c3ae11cc0e6c115f950c89bc949646be55ed18d6a2912
deleted: sha256:a4320831346648c03db64149eafc83092e2b34ab50ca6e8c13112388f25899a7
deleted: sha256:4c76020202ee1d9709e703b7c6de367b325139e74eebd6b55b30a63c196abaf3
deleted: sha256:d7afd92fb07236c8a2045715a86b7d5f0066cef025018cd3ca9a45498c51d1d6
deleted: sha256:9e63c5bce4585dd7038d830a1f1f4e44cb1a1515b00e620ac718e934b484c938
untagged: debian:jessie
untagged: debian@sha256:c1af755d300d0c65bb1194d24bce561d70c98a54fb5ce5b1693beb4f7988272f
deleted: sha256:7b0a06c805e8f23807fb8856621c60851727e85c7bcb751012c813f122734c8d
deleted: sha256:f96222d75c5563900bc4dd852179b720a0885de8f7a0619ba0ac76e92542bbc8
Total reclaimed space: 792.6 MB
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
foo latest 2f287ac753da About a minute ago 3.98 MB
alpine latest 88e169ea8f46 8 days ago 3.98 MB
busybox latest e02e811dd08f 2 months ago 1.09 MB
```

View File

@ -143,6 +143,7 @@ examples: |-
* label (`label=<key>` or `label=<key>=<value>`)
* before (`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) - filter images created before given id or references
* since (`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) - filter images created since given id or references
* reference (pattern of an image reference) - filter images whose reference matches the specified pattern
#### Show untagged images (dangling)

View File

@ -45,7 +45,7 @@ examples: |-
### Get an instance's image name
```bash
$ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID
$ docker inspect --format='{{.Config.Image}}' $INSTANCE_ID
```
### List all port bindings

View File

@ -1,6 +1,8 @@
command: docker network
short: Manage networks
long: Manage networks
long: |-
Manage networks. You can use subcommand to create, list, inspect, remove,
connect and disconnect networks.
usage: docker network
pname: docker
plink: docker.yaml

View File

@ -22,51 +22,3 @@ examples: |-
n2
```
### Filtering
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
The currently supported filters are:
* until (`<timestamp>`) - only remove networks created before given timestamp
The `until` filter can be Unix timestamps, date formatted
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
relative to the daemon machines time. Supported formats for date
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
timezone on the daemon will be used if you do not provide either a `Z` or a
`+-00:00` timezone offset at the end of the timestamp. When providing Unix
timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
fraction of a second no more than nine digits long.
The following removes networks created more than 5 minutes ago. Note that
system networks such as `bridge`, `host`, and `none` will never be pruned:
```none
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
7430df902d7a bridge bridge local
ea92373fd499 foo-1-day-ago bridge local
ab53663ed3c7 foo-1-min-ago bridge local
97b91972bc3b host host local
f949d337b1f5 none null local
$ docker network prune --force --filter until=5m
Deleted Networks:
foo-1-day-ago
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
7430df902d7a bridge bridge local
ab53663ed3c7 foo-1-min-ago bridge local
97b91972bc3b host host local
f949d337b1f5 none null local
```

View File

@ -1,6 +1,6 @@
command: docker node
short: Manage Swarm nodes
long: Manage Swarm nodes
long: Manage nodes.
usage: docker node
pname: docker
plink: docker.yaml

View File

@ -1,6 +1,6 @@
command: docker plugin
short: Manage plugins
long: Manage plugins
long: Manage plugins.
usage: docker plugin
pname: docker
plink: docker.yaml

View File

@ -19,62 +19,3 @@ examples: |-
69553ca1d123 tiborvass/sample-volume-plugin latest A test plugin for Docker true
```
### Filtering
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
The currently supported filters are:
* enabled (boolean - true or false, 0 or 1)
* capability (string - currently `volumedriver`, `networkdriver`, `ipamdriver`, or `authz`)
#### enabled
The `enabled` filter matches on plugins enabled or disabled.
#### capability
The `capability` filter matches on plugin capabilities. One plugin
might have multiple capabilities. Currently `volumedriver`, `networkdriver`,
`ipamdriver`, and `authz` are supported capabilities.
```bash
$ docker plugin install --disable tiborvass/no-remove
tiborvass/no-remove
$ docker plugin ls --filter enabled=true
NAME TAG DESCRIPTION ENABLED
```
### Formatting
The formatting options (`--format`) pretty-prints plugins output
using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
---------------|------------------------------------------------------------------------------------------
`.ID` | Plugin ID
`.Name` | Plugin name
`.Description` | Plugin description
`.Enabled` | Whether plugin is enabled or not
`.PluginReference` | The reference used to push/pull from a registry
When using the `--format` option, the `plugin ls` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`ID` and `Name` entries separated by a colon for all plugins:
```bash
$ docker plugin ls --format "{{.ID}}: {{.Name}}"
4be01827a72e: tiborvass/no-remove
```

View File

@ -324,46 +324,6 @@ examples: |-
9d4893ed80fe ubuntu "top" 10 minutes ago Up 10 minutes test1
```
#### publish and expose
The `publish` and `expose` filters show only containers that have published or exposed port with a given port
number, port range, and/or protocol. The default protocol is `tcp` when not specified.
The following filter matches all containers that have published port of 80:
```bash
$ docker run -d --publish=80 busybox top
$ docker run -d --expose=8080 busybox top
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9833437217a5 busybox "top" 5 seconds ago Up 4 seconds 8080/tcp dreamy_mccarthy
fc7e477723b7 busybox "top" 50 seconds ago Up 50 seconds 0.0.0.0:32768->80/tcp admiring_roentgen
$ docker ps --filter publish=80
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fc7e477723b7 busybox "top" About a minute ago Up About a minute 0.0.0.0:32768->80/tcp admiring_roentgen
```
The following filter matches all containers that have exposed TCP port in the range of `8000-8080`:
```bash
$ docker ps --filter expose=8000-8080/tcp
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9833437217a5 busybox "top" 21 seconds ago Up 19 seconds 8080/tcp dreamy_mccarthy
```
The following filter matches all containers that have exposed UDP port `80`:
```bash
$ docker ps --filter publish=80/udp
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
```
### Formatting
The formatting option (`--format`) pretty-prints container output using a Go

View File

@ -1,23 +1,17 @@
command: docker push
short: Push an image or a repository to a registry
long: |-
Use `docker push` to share your images to the [Docker Hub](https://hub.docker.com)
registry or to a self-hosted one.
Refer to the [`docker tag`](tag.md) reference for more information about valid
image and tag names.
Killing the `docker push` process, for example by pressing `CTRL-c` while it is
running in a terminal, terminates the push operation.
Registry credentials are managed by [docker login](login.md).
### Concurrent uploads
By default the Docker daemon will push five layers of an image at a time.
If you are on a low bandwidth connection this may cause timeout issues and you may want to lower
this via the `--max-concurrent-uploads` daemon option. See the
[daemon documentation](dockerd.md) for more details.
long: "Use `docker push` to share your images to the [Docker Hub](https://hub.docker.com)\nregistry
or to a self-hosted one.\n\nRefer to the [`docker tag`](tag.md) reference for more
information about valid\nimage and tag names.\n\nKilling the `docker push` process,
for example by pressing `CTRL-c` while it is\nrunning in a terminal, terminates
the push operation.\n\nProgress bars are shown during docker push, which show the
uncompressed size. The \nactual amount of data that's pushed will be compressed
before sending, so the uploaded\n size will not be reflected by the progress bar.
\n\nRegistry credentials are managed by [docker login](login.md).\n\n### Concurrent
uploads\n\nBy default the Docker daemon will push five layers of an image at a time.\nIf
you are on a low bandwidth connection this may cause timeout issues and you may
want to lower\nthis via the `--max-concurrent-uploads` daemon option. See the\n[daemon
documentation](dockerd.md) for more details."
usage: docker push [OPTIONS] NAME[:TAG]
pname: docker
plink: docker.yaml

View File

@ -1,6 +1,17 @@
command: docker run
short: Run a command in a new container
long: Run a command in a new container
long: |-
The `docker run` command first `creates` a writeable container layer over the
specified image, and then `starts` it using the specified command. That is,
`docker run` is equivalent to the API `/containers/create` then
`/containers/(id)/start`. A stopped container can be restarted with all its
previous changes intact using `docker start`. See `docker ps -a` to view a list
of all containers.
The `docker run` command can be used in combination with `docker commit` to
[*change the command that a container runs*](commit.md). There is additional detailed information about `docker run` in the [Docker run reference](../run.md).
For information on connecting a container to a network, see the ["*Docker network overview*"](https://docs.docker.com/engine/userguide/networking/).
usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
pname: docker
plink: docker.yaml

View File

@ -1,6 +1,6 @@
command: docker secret
short: Manage Docker secrets
long: Manage Docker secrets
long: Manage secrets.
usage: docker secret
pname: docker
plink: docker.yaml

View File

@ -1,8 +1,8 @@
command: docker secret create
short: Create a secret from a file or STDIN as content
long: |-
Creates a secret using standard input or from a file for the secret content. You must run this
command on a manager node.
long: "Creates a secret using standard input or from a file for the secret content.
You must run this command on a manager node. \n\nFor detailed information about
using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/)."
usage: docker secret create [OPTIONS] SECRET file|-
pname: docker secret
plink: docker_secret.yaml

View File

@ -9,6 +9,8 @@ long: |-
Go's [text/template](http://golang.org/pkg/text/template/) package
describes all the details of the format.
For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
usage: docker secret inspect [OPTIONS] SECRET [SECRET...]
pname: docker secret
plink: docker_secret.yaml

View File

@ -1,7 +1,10 @@
command: docker secret ls
aliases: list
short: List secrets
long: Run this command on a manager node to list the secrets in the swarm.
long: |-
Run this command on a manager node to list the secrets in the swarm.
For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
usage: docker secret ls [OPTIONS]
pname: docker secret
plink: docker_secret.yaml

View File

@ -4,6 +4,8 @@ short: Remove one or more secrets
long: |-
Removes the specified secrets from the swarm. This command has to be run
targeting a manager node.
For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/).
usage: docker secret rm SECRET [SECRET...]
pname: docker secret
plink: docker_secret.yaml

View File

@ -1,6 +1,6 @@
command: docker service
short: Manage services
long: Manage services
long: Manage services.
usage: docker service
pname: docker
plink: docker.yaml

View File

@ -605,8 +605,8 @@ examples: |-
<td><tt>node.hostname != node-2</tt></td>
</tr>
<tr>
<td<tt>node.role</tt></td>
<td><tt>node role: manager</tt></td>
<td><tt>node.role</tt></td>
<td>Node role</td>
<td><tt>node.role == manager</tt></td>
</tr>
<tr>

View File

@ -89,5 +89,3 @@ examples: |-
0bcjwfh8ychr redis replicated 1/1 redis:3.0.6
```
<<<<<<< HEAD

View File

@ -1,6 +1,6 @@
command: docker stack
short: Manage Docker stacks
long: Manage Docker stacks
long: Manage stacks.
usage: docker stack
pname: docker
plink: docker.yaml

View File

@ -47,32 +47,3 @@ examples: |-
* name (`--filter name=myapp_web`)
* label (`--filter label=key=value`)
### Formatting
The formatting options (`--format`) pretty-prints services output
using a Go template.
Valid placeholders for the Go template are listed below:
Placeholder | Description
------------|------------------------------------------------------------------------------------------
`.ID` | Service ID
`.Name` | Service name
`.Mode` | Service mode (replicated, global)
`.Replicas` | Service replicas
`.Image` | Service image
When using the `--format` option, the `stack services` command will either
output the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.
The following example uses a template without headers and outputs the
`ID`, `Mode`, and `Replicas` entries separated by a colon for all services:
```bash
$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
0zmvwuiu3vue: replicated 10/10
fm6uf97exkul: global 5/5
```

View File

@ -1,6 +1,6 @@
command: docker swarm
short: Manage Swarm
long: Manage Swarm
long: Manage the swarm.
usage: docker swarm
pname: docker
plink: docker.yaml

View File

@ -132,12 +132,3 @@ examples: |-
state to new managers. However, there is a performance cost to taking snapshots
frequently.
### `--availability`
This flag specifies the availability of the node at the time the node joins a master.
Possible availability values are `active`, `pause`, or `drain`.
This flag is useful in certain situations. For example, a cluster may want to have
dedicated manager nodes that are not served as worker nodes. This could be achieved
by passing `--availability=drain` to `docker swarm init`.

View File

@ -1,6 +1,6 @@
command: docker system
short: Manage Docker
long: Manage Docker
long: Manage docker.
usage: docker system
pname: docker
plink: docker.yaml

View File

@ -29,19 +29,5 @@ examples: "```bash\n$ docker system prune -a\n\nWARNING! This will remove:\n\t-
my-jq:latest\ndeleted: sha256:6e66d724542af9bc4c4abf4a909791d7260b6d0110d8e220708b09e4ee1322e1\ndeleted:
sha256:07b3fa89d4b17009eb3988dfc592c7d30ab3ba52d2007832dffcf6d40e3eda7f\ndeleted:
sha256:3a88a5c81eb5c283e72db2dbc6d65cbfd8e80b6c89bb6e714cfaaa0eed99c548\n\nTotal
reclaimed space: 13.5 MB\n```\n\n### Filtering\n\nThe filtering flag (`-f` or `--filter`)
format is of \"key=value\". If there is more\nthan one filter, then pass multiple
flags (e.g., `--filter \"foo=bar\" --filter \"bif=baz\"`)\n\nThe currently supported
filters are:\n\n* until (`<timestamp>`) - only remove containers, images, and networks
created before given timestamp\n\nThe `until` filter can be Unix timestamps, date
formatted\ntimestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed\nrelative
to the daemon machines time. Supported formats for date\nformatted time stamps
include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,\n`2006-01-02T15:04:05.999999999`,
`2006-01-02Z07:00`, and `2006-01-02`. The local\ntimezone on the daemon will be
used if you do not provide either a `Z` or a\n`+-00:00` timezone offset at the end
of the timestamp. When providing Unix\ntimestamps enter seconds[.nanoseconds],
where seconds is the number of seconds\nthat have elapsed since January 1, 1970
(midnight UTC/GMT), not counting leap\nseconds (aka Unix epoch or Unix time), and
the optional .nanoseconds field is a\nfraction of a second no more than nine digits
long."
reclaimed space: 13.5 MB\n```"

View File

@ -1,22 +1,8 @@
command: docker volume
short: Manage volumes
long: |2+
The **docker volume** command has subcommands for managing data volumes. A data
volume is a specially-designated directory that by-passes storage driver
management.
Data volumes persist data independent of a container's life cycle. When you
delete a container, the Docker daemon does not delete any data volumes. You can
share volumes across multiple containers. Moreover, you can share data volumes
with other computing resources in your system.
To see help for a subcommand, use:
docker volume COMMAND --help
For full details on using docker volume visit Docker's online documentation.
long: |-
Manage volumes. You can use subcommand to create, list, inspect, remove
volumes.
usage: docker volume COMMAND
pname: docker
plink: docker.yaml