mirror of https://github.com/docker/cli.git
docs: fix anchors
Signed-off-by: Kevin Alvarez <crazy-max@users.noreply.github.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 186dcf30b1
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
8dcfddb49a
commit
fb1fb991f2
|
@ -332,7 +332,7 @@ found, the `.dockerignore` file is used if present. Using a Dockerfile based
|
||||||
expect to ignore different sets of files.
|
expect to ignore different sets of files.
|
||||||
|
|
||||||
|
|
||||||
### <a name=tag></a> Tag an image (-t, --tag)
|
### <a name="tag"></a> Tag an image (-t, --tag)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker build -t vieux/apache:2.0 .
|
$ docker build -t vieux/apache:2.0 .
|
||||||
|
@ -352,7 +352,7 @@ For example, to tag an image both as `whenry/fedora-jboss:latest` and
|
||||||
$ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 .
|
$ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 .
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=file></a> Specify a Dockerfile (-f, --file)
|
### <a name="file"></a> Specify a Dockerfile (-f, --file)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker build -f Dockerfile.debug .
|
$ docker build -f Dockerfile.debug .
|
||||||
|
@ -399,17 +399,17 @@ the command line.
|
||||||
> repeatable builds on remote Docker hosts. This is also the reason why
|
> repeatable builds on remote Docker hosts. This is also the reason why
|
||||||
> `ADD ../file` does not work.
|
> `ADD ../file` does not work.
|
||||||
|
|
||||||
### <a name=cgroup-parent></a> Use a custom parent cgroup (--cgroup-parent)
|
### <a name="cgroup-parent"></a> Use a custom parent cgroup (--cgroup-parent)
|
||||||
|
|
||||||
When `docker build` is run with the `--cgroup-parent` option the containers
|
When `docker build` is run with the `--cgroup-parent` option the containers
|
||||||
used in the build will be run with the [corresponding `docker run` flag](../run.md#specify-custom-cgroups).
|
used in the build will be run with the [corresponding `docker run` flag](../run.md#specify-custom-cgroups).
|
||||||
|
|
||||||
### <a name=ulimit></a> Set ulimits in container (--ulimit)
|
### <a name="ulimit"></a> Set ulimits in container (--ulimit)
|
||||||
|
|
||||||
Using the `--ulimit` option with `docker build` will cause each build step's
|
Using the `--ulimit` option with `docker build` will cause each build step's
|
||||||
container to be started using those [`--ulimit` flag values](run.md#ulimit).
|
container to be started using those [`--ulimit` flag values](run.md#ulimit).
|
||||||
|
|
||||||
### <a name=build-arg></a> Set build-time variables (--build-arg)
|
### <a name="build-arg"></a> Set build-time variables (--build-arg)
|
||||||
|
|
||||||
You can use `ENV` instructions in a Dockerfile to define variable
|
You can use `ENV` instructions in a Dockerfile to define variable
|
||||||
values. These values persist in the built image. However, often
|
values. These values persist in the built image. However, often
|
||||||
|
@ -447,13 +447,13 @@ $ docker build --build-arg HTTP_PROXY .
|
||||||
This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](run.md#env)
|
This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](run.md#env)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
### <a name=security-opt></a> Optional security options (--security-opt)
|
### <a name="security-opt"></a> Optional security options (--security-opt)
|
||||||
|
|
||||||
This flag is only supported on a daemon running on Windows, and only supports
|
This flag is only supported on a daemon running on Windows, and only supports
|
||||||
the `credentialspec` option. The `credentialspec` must be in the format
|
the `credentialspec` option. The `credentialspec` must be in the format
|
||||||
`file://spec.txt` or `registry://keyname`.
|
`file://spec.txt` or `registry://keyname`.
|
||||||
|
|
||||||
### <a name=isolation></a> Specify isolation technology for container (--isolation)
|
### <a name="isolation"></a> Specify isolation technology for container (--isolation)
|
||||||
|
|
||||||
This option is useful in situations where you are running Docker containers on
|
This option is useful in situations where you are running Docker containers on
|
||||||
Windows. The `--isolation=<value>` option sets a container's isolation
|
Windows. The `--isolation=<value>` option sets a container's isolation
|
||||||
|
@ -469,7 +469,7 @@ Linux namespaces. On Microsoft Windows, you can specify these values:
|
||||||
|
|
||||||
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
|
Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`.
|
||||||
|
|
||||||
### <a name=add-host></a> Add entries to container hosts file (--add-host)
|
### <a name="add-host"></a> Add entries to container hosts file (--add-host)
|
||||||
|
|
||||||
You can add other hosts into a container's `/etc/hosts` file by using one or
|
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
|
more `--add-host` flags. This example adds a static address for a host named
|
||||||
|
@ -477,7 +477,7 @@ more `--add-host` flags. This example adds a static address for a host named
|
||||||
|
|
||||||
$ docker build --add-host=docker:10.180.0.1 .
|
$ docker build --add-host=docker:10.180.0.1 .
|
||||||
|
|
||||||
### <a name=target></a> Specifying target build stage (--target)
|
### <a name="target"></a> Specifying target build stage (--target)
|
||||||
|
|
||||||
When building a Dockerfile with multiple build stages, `--target` can be used to
|
When building a Dockerfile with multiple build stages, `--target` can be used to
|
||||||
specify an intermediate build stage by name as a final stage for the resulting
|
specify an intermediate build stage by name as a final stage for the resulting
|
||||||
|
@ -495,7 +495,7 @@ FROM alpine AS production-env
|
||||||
$ docker build -t mybuildimage --target build-env .
|
$ docker build -t mybuildimage --target build-env .
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=output></a> Custom build outputs (--output)
|
### <a name="output"></a> Custom build outputs (--output)
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
|
@ -589,7 +589,7 @@ $ ls ./out
|
||||||
vndr
|
vndr
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=cache-from></a> Specifying external cache sources (--cache-from)
|
### <a name="cache-from"></a> Specifying external cache sources (--cache-from)
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
|
@ -632,7 +632,7 @@ On another machine:
|
||||||
$ docker build --cache-from myname/myapp .
|
$ docker build --cache-from myname/myapp .
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=squash></a> Squash an image's layers (--squash) (experimental)
|
### <a name="squash"></a> Squash an image's layers (--squash) (experimental)
|
||||||
|
|
||||||
#### Overview
|
#### Overview
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ REPOSITORY TAG ID CREATE
|
||||||
svendowideit/testimage version3 f5283438590d 16 seconds ago 335.7 MB
|
svendowideit/testimage version3 f5283438590d 16 seconds ago 335.7 MB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=change></a> Commit a container with new configurations (--change)
|
### <a name="change"></a> Commit a container with new configurations (--change)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker ps
|
$ docker ps
|
||||||
|
|
|
@ -57,7 +57,7 @@ ID NAME CREATED UPDATED
|
||||||
dg426haahpi5ezmkkj5kyl3sn my_config 7 seconds ago 7 seconds ago
|
dg426haahpi5ezmkkj5kyl3sn my_config 7 seconds ago 7 seconds ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=label></a> Create a config with labels (-l, --label)
|
### <a name="label"></a> Create a config with labels (-l, --label)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker config create \
|
$ docker config create \
|
||||||
|
|
|
@ -77,7 +77,7 @@ The output is in JSON format, for example:
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
You can use the --format option to obtain specific information about a
|
You can use the --format option to obtain specific information about a
|
||||||
config. The following example command outputs the creation time of the
|
config. The following example command outputs the creation time of the
|
||||||
|
|
|
@ -45,7 +45,7 @@ ID NAME CREATED UPDA
|
||||||
mem02h8n73mybpgqjf0kfi1n0 test_config 3 seconds ago 3 seconds ago
|
mem02h8n73mybpgqjf0kfi1n0 test_config 3 seconds ago 3 seconds ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (-f, --filter)
|
### <a name="filter"></a> Filtering (-f, --filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
||||||
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -105,7 +105,7 @@ ID NAME CREATED UPDA
|
||||||
mem02h8n73mybpgqjf0kfi1n0 test_config About an hour ago About an hour ago
|
mem02h8n73mybpgqjf0kfi1n0 test_config About an hour ago About an hour ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty prints configs output
|
The formatting option (`--format`) pretty prints configs output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -37,7 +37,7 @@ f98f9c2aa1eaf727e4ec9c0283bc7d4aa4762fbdba7f26191f26c97f64090360
|
||||||
Total reclaimed space: 212 B
|
Total reclaimed space: 212 B
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`--filter`) format is of "key=value". If there is more
|
The filtering flag (`--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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
|
|
@ -69,7 +69,7 @@ $ docker context create \
|
||||||
my-context
|
my-context
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=from></a> Create a context based on an existing context (--from)
|
### <a name="from"></a> Create a context based on an existing context (--from)
|
||||||
|
|
||||||
Use the `--from=<context-name>` option to create a new context from
|
Use the `--from=<context-name>` option to create a new context from
|
||||||
an existing context. The example below creates a new context named `my-context`
|
an existing context. The example below creates a new context named `my-context`
|
||||||
|
|
|
@ -141,7 +141,7 @@ Docker configs report the following events:
|
||||||
|
|
||||||
### Limiting, filtering, and formatting the output
|
### Limiting, filtering, and formatting the output
|
||||||
|
|
||||||
#### <a name=since></a> Limit events by time (--since, --until)
|
#### <a name="since"></a> Limit events by time (--since, --until)
|
||||||
|
|
||||||
The `--since` and `--until` parameters can be Unix timestamps, date formatted
|
The `--since` and `--until` parameters can be Unix timestamps, date formatted
|
||||||
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
|
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
|
||||||
|
@ -159,7 +159,7 @@ fraction of a second no more than nine digits long.
|
||||||
Only the last 1000 log events are returned. You can use filters to further limit
|
Only the last 1000 log events are returned. You can use filters to further limit
|
||||||
the number of events returned.
|
the number of events returned.
|
||||||
|
|
||||||
#### <a name=filter></a> Filtering (--filter)
|
#### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If you would
|
The filtering flag (`-f` or `--filter`) format is of "key=value". If you would
|
||||||
like to use multiple filters, pass multiple flags (e.g.,
|
like to use multiple filters, pass multiple flags (e.g.,
|
||||||
|
@ -190,7 +190,7 @@ The currently supported filters are:
|
||||||
* type (`type=<container or image or volume or network or daemon or plugin or service or node or secret or config>`)
|
* type (`type=<container or image or volume or network or daemon or plugin or service or node or secret or config>`)
|
||||||
* volume (`volume=<name>`)
|
* volume (`volume=<name>`)
|
||||||
|
|
||||||
#### <a name=format></a> Format the output (--format)
|
#### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
If a format (`--format`) is specified, the given template will be executed
|
If a format (`--format`) is specified, the given template will be executed
|
||||||
instead of the default
|
instead of the default
|
||||||
|
|
|
@ -73,7 +73,7 @@ $ docker exec -it mycontainer sh
|
||||||
|
|
||||||
This starts a new shell session in the container `mycontainer`.
|
This starts a new shell session in the container `mycontainer`.
|
||||||
|
|
||||||
### <a name=env></a> Set environment variables for the exec process (--env, -e)
|
### <a name="env"></a> Set environment variables for the exec process (--env, -e)
|
||||||
|
|
||||||
Next, set environment variables in the current bash session.
|
Next, set environment variables in the current bash session.
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ VAR_B=2
|
||||||
HOME=/root
|
HOME=/root
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=workdir></a> Set the working directory for the exec process (--workdir, -w)
|
### <a name="workdir"></a> Set the working directory for the exec process (--workdir, -w)
|
||||||
|
|
||||||
By default `docker exec` command runs in the same working directory set when
|
By default `docker exec` command runs in the same working directory set when
|
||||||
the container was created.
|
the container was created.
|
||||||
|
|
|
@ -47,7 +47,7 @@ c69cab00d6ef 5 months ago /bin/sh -c #(nop) MAINTAINER Lokesh Mand
|
||||||
511136ea3c5a 19 months ago 0 B Imported from -
|
511136ea3c5a 19 months ago 0 B Imported from -
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) will pretty-prints history output
|
The formatting option (`--format`) will pretty-prints history output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -59,7 +59,7 @@ deleted: sha256:2c675ee9ed53425e31a13e3390bf3f539bf8637000e4bcfbb85ee03ef4d910a1
|
||||||
Total reclaimed space: 16.43 MB
|
Total reclaimed space: 16.43 MB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`--filter`) format is of "key=value". If there is more
|
The filtering flag (`--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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
|
|
@ -103,7 +103,7 @@ $ docker images java:0
|
||||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=no-trunc></a> List the full length image IDs (--no-trunc)
|
### <a name="no-trunc"></a> List the full length image IDs (--no-trunc)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker images --no-trunc
|
$ docker images --no-trunc
|
||||||
|
@ -120,7 +120,7 @@ tryout latest sha256:2629d1fa0b81b222fca6337
|
||||||
<none> <none> sha256:5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df 24 hours ago 1.089 GB
|
<none> <none> sha256:5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df 24 hours ago 1.089 GB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=digests></a> List image digests (--digests)
|
### <a name="digests"></a> List image digests (--digests)
|
||||||
|
|
||||||
Images that use the v2 or later format have a content-addressable identifier
|
Images that use the v2 or later format have a content-addressable identifier
|
||||||
called a `digest`. As long as the input used to generate the image is
|
called a `digest`. As long as the input used to generate the image is
|
||||||
|
@ -138,7 +138,7 @@ output includes the image digest. You can `pull` using a digest value. You can
|
||||||
also reference by digest in `create`, `run`, and `rmi` commands, as well as the
|
also reference by digest in `create`, `run`, and `rmi` commands, as well as the
|
||||||
`FROM` image reference in a Dockerfile.
|
`FROM` image reference in a Dockerfile.
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
|
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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -286,7 +286,7 @@ busybox uclibc e02e811dd08f 5 weeks ago
|
||||||
busybox glibc 21c16b6787c6 5 weeks ago 4.19 MB
|
busybox glibc 21c16b6787c6 5 weeks ago 4.19 MB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) will pretty print container output
|
The formatting option (`--format`) will pretty print container output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -112,7 +112,7 @@ Server:
|
||||||
Live Restore Enabled: false
|
Live Restore Enabled: false
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
You can also specify the output format:
|
You can also specify the output format:
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,14 @@ Docker inspect provides detailed information on constructs controlled by Docker.
|
||||||
|
|
||||||
By default, `docker inspect` will render results in a JSON array.
|
By default, `docker inspect` will render results in a JSON array.
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
If a format is specified, the given template will be executed for each result.
|
If a format is specified, the given template will be executed for each result.
|
||||||
|
|
||||||
Go's [text/template](https://golang.org/pkg/text/template/) package describes
|
Go's [text/template](https://golang.org/pkg/text/template/) package describes
|
||||||
all the details of the format.
|
all the details of the format.
|
||||||
|
|
||||||
### <a name=type></a>Specify target type (--type)
|
### <a name="type"></a> Specify target type (--type)
|
||||||
|
|
||||||
`--type container|image|node|network|secret|service|volume|task|plugin`
|
`--type container|image|node|network|secret|service|volume|task|plugin`
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ The following example inspects a _volume_ named "myvolume"
|
||||||
$ docker inspect --type=volume myvolume
|
$ docker inspect --type=volume myvolume
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=size></a> Inspect the size of a container (-s, --size)
|
### <a name="size"></a> Inspect the size of a container (-s, --size)
|
||||||
|
|
||||||
The `--size`, or short-form `-s`, option adds two additional fields to the
|
The `--size`, or short-form `-s`, option adds two additional fields to the
|
||||||
`docker inspect` output. This option only works for containers. The container
|
`docker inspect` output. This option only works for containers. The container
|
||||||
|
|
|
@ -51,7 +51,7 @@ The following example sends the default `SIGKILL` signal to the container named
|
||||||
$ docker kill my_container
|
$ docker kill my_container
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=signal></a>Send a custom signal to a container (--signal)
|
### <a name="signal"></a> Send a custom signal to a container (--signal)
|
||||||
|
|
||||||
The following example sends a `SIGHUP` signal to the container named
|
The following example sends a `SIGHUP` signal to the container named
|
||||||
`my_container`:
|
`my_container`:
|
||||||
|
|
|
@ -43,7 +43,7 @@ REPOSITORY TAG IMAGE ID CREATED
|
||||||
busybox latest 769b9341d937 7 weeks ago 2.489 MB
|
busybox latest 769b9341d937 7 weeks ago 2.489 MB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=input></a> Load images from a file (--input)
|
### <a name="input"></a> Load images from a file (--input)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker load --input fedora.tar
|
$ docker load --input fedora.tar
|
||||||
|
|
|
@ -34,7 +34,7 @@ adding the server name.
|
||||||
$ docker login localhost:8080
|
$ docker login localhost:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=password-stdin></a> Provide a password using STDIN (--password-stdin)
|
### <a name="password-stdin"></a> Provide a password using STDIN (--password-stdin)
|
||||||
|
|
||||||
To run the `docker login` command non-interactively, you can set the
|
To run the `docker login` command non-interactively, you can set the
|
||||||
`--password-stdin` flag to provide a password through `STDIN`. Using
|
`--password-stdin` flag to provide a password through `STDIN`. Using
|
||||||
|
|
|
@ -58,7 +58,7 @@ fraction of a second no more than nine digits long. You can combine the
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### <a name=until></a> Retrieve logs until a specific point in time (--until)
|
### <a name="until"></a> Retrieve logs until a specific point in time (--until)
|
||||||
|
|
||||||
In order to retrieve logs before a specific point in time, run:
|
In order to retrieve logs before a specific point in time, run:
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ container and immediately connect it to a network.
|
||||||
$ docker run -itd --network=multi-host-network busybox
|
$ docker run -itd --network=multi-host-network busybox
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=ip></a> Specify the IP address a container will use on a given network (--ip)
|
### <a name="ip"></a> Specify the IP address a container will use on a given network (--ip)
|
||||||
|
|
||||||
You can specify the IP address you want to be assigned to the container's interface.
|
You can specify the IP address you want to be assigned to the container's interface.
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ You can specify the IP address you want to be assigned to the container's interf
|
||||||
$ docker network connect --ip 10.10.36.122 multi-host-network container2
|
$ docker network connect --ip 10.10.36.122 multi-host-network container2
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=link></a> Use the legacy `--link` option (--link)
|
### <a name="link"></a> Use the legacy `--link` option (--link)
|
||||||
|
|
||||||
You can use `--link` option to link another container with a preferred alias
|
You can use `--link` option to link another container with a preferred alias
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ You can use `--link` option to link another container with a preferred alias
|
||||||
$ docker network connect --link container1:c1 multi-host-network container2
|
$ docker network connect --link container1:c1 multi-host-network container2
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=alias></a> Create a network alias for a container (--alias)
|
### <a name="alias"></a> Create a network alias for a container (--alias)
|
||||||
|
|
||||||
`--alias` option can be used to resolve the container by another name in the network
|
`--alias` option can be used to resolve the container by another name in the network
|
||||||
being connected to.
|
being connected to.
|
||||||
|
|
|
@ -197,14 +197,14 @@ $ docker network create \
|
||||||
simple-network
|
simple-network
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=internal></a> Network internal mode (--internal)
|
### <a name="internal"></a> Network internal mode (--internal)
|
||||||
|
|
||||||
By default, when you connect a container to an `overlay` network, Docker also
|
By default, when you connect a container to an `overlay` network, Docker also
|
||||||
connects a bridge network to it to provide external connectivity. If you want
|
connects a bridge network to it to provide external connectivity. If you want
|
||||||
to create an externally isolated `overlay` network, you can specify the
|
to create an externally isolated `overlay` network, you can specify the
|
||||||
`--internal` option.
|
`--internal` option.
|
||||||
|
|
||||||
### <a name=ingress></a> Network ingress mode (--ingress)
|
### <a name="ingress"></a> Network ingress mode (--ingress)
|
||||||
|
|
||||||
You can create the network which will be used to provide the routing-mesh in the
|
You can create the network which will be used to provide the routing-mesh in the
|
||||||
swarm cluster. You do so by specifying `--ingress` when creating the network. Only
|
swarm cluster. You do so by specifying `--ingress` when creating the network. Only
|
||||||
|
|
|
@ -204,7 +204,7 @@ The output is in JSON format, for example:
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=verbose></a> View detailed information of a network (--verbose)
|
### <a name="verbose"></a> View detailed information of a network (--verbose)
|
||||||
|
|
||||||
`docker network inspect --verbose` for swarm mode overlay networks shows service-specific
|
`docker network inspect --verbose` for swarm mode overlay networks shows service-specific
|
||||||
details such as the service's VIP and port mappings. It also shows IPs of service tasks,
|
details such as the service's VIP and port mappings. It also shows IPs of service tasks,
|
||||||
|
|
|
@ -52,7 +52,7 @@ c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host
|
||||||
63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge local
|
63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge local
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
||||||
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
||||||
|
@ -197,7 +197,7 @@ $ docker network rm `docker network ls --filter type=custom -q`
|
||||||
A warning will be issued when trying to remove a network that has containers
|
A warning will be issued when trying to remove a network that has containers
|
||||||
attached.
|
attached.
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints networks output
|
The formatting options (`--format`) pretty-prints networks output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -34,7 +34,7 @@ n1
|
||||||
n2
|
n2
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`--filter`) format is of "key=value". If there is more
|
The filtering flag (`--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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
|
|
@ -111,7 +111,7 @@ $ docker node inspect swarm-manager
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
|
$ docker node inspect --format '{{ .ManagerStatus.Leader }}' self
|
||||||
|
|
|
@ -52,7 +52,7 @@ e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader
|
||||||
> `e216jshn25ckzbvmwlnh5jr3g *`) means this node is the current docker daemon.
|
> `e216jshn25ckzbvmwlnh5jr3g *`) means this node is the current docker daemon.
|
||||||
|
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
|
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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -170,7 +170,7 @@ ID HOSTNAME STATUS AVAILABILITY MANAGER STATU
|
||||||
e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader
|
e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints nodes output
|
The formatting options (`--format`) pretty-prints nodes output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -47,7 +47,7 @@ redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running
|
||||||
redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
|
redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
|
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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -108,7 +108,7 @@ redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running R
|
||||||
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
|
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
|
||||||
|
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints tasks output
|
The formatting options (`--format`) pretty-prints tasks output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -52,7 +52,7 @@ Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
|
||||||
down and can't be removed
|
down and can't be removed
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=force></a> Forcibly remove an inaccessible node from a swarm (--force)
|
### <a name="force"></a> Forcibly remove an inaccessible node from a swarm (--force)
|
||||||
|
|
||||||
If you lose access to a worker node or need to shut it down because it has been
|
If you lose access to a worker node or need to shut it down because it has been
|
||||||
compromised or is not behaving as expected, you can use the `--force` option.
|
compromised or is not behaving as expected, you can use the `--force` option.
|
||||||
|
|
|
@ -32,7 +32,7 @@ Update metadata about a node, such as its availability, labels, or roles.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### <a name=label-add></a> Add label metadata to a node (--label-add)
|
### <a name="label-add"></a> Add label metadata to a node (--label-add)
|
||||||
|
|
||||||
Add metadata to a swarm node using node labels. You can specify a node label as
|
Add metadata to a swarm node using node labels. You can specify a node label as
|
||||||
a key with an empty value:
|
a key with an empty value:
|
||||||
|
|
|
@ -142,7 +142,7 @@ Output is in JSON format (output below is formatted for readability):
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
|
$ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest
|
||||||
|
|
|
@ -38,7 +38,7 @@ ID NAME DESCRIPTION
|
||||||
69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker true
|
69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker true
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Filtering (--filter)
|
### <a name="format"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
|
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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -68,7 +68,7 @@ $ docker plugin ls --filter enabled=true
|
||||||
ID NAME DESCRIPTION ENABLED
|
ID NAME DESCRIPTION ENABLED
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints plugins output
|
The formatting options (`--format`) pretty-prints plugins output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -41,7 +41,7 @@ Options:
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### <a name=no-trunc></a> Do not truncate output (--no-trunc)
|
### <a name="no-trunc"></a> Do not truncate output (--no-trunc)
|
||||||
|
|
||||||
Running `docker ps --no-trunc` showing 2 linked containers.
|
Running `docker ps --no-trunc` showing 2 linked containers.
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ CONTAINER ID IMAGE COMMAND CREATED
|
||||||
d7886598dbe2 crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db
|
d7886598dbe2 crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=all></a> Show both running and stopped containers (-a, --all)
|
### <a name="all"></a> Show both running and stopped containers (-a, --all)
|
||||||
|
|
||||||
The `docker ps` command only shows running containers by default. To see all
|
The `docker ps` command only shows running containers by default. To see all
|
||||||
containers, use the `--all` (or `-a`) flag:
|
containers, use the `--all` (or `-a`) flag:
|
||||||
|
@ -66,7 +66,7 @@ $ docker ps -a
|
||||||
container that exposes TCP ports `100, 101, 102` displays `100-102/tcp` in
|
container that exposes TCP ports `100, 101, 102` displays `100-102/tcp` in
|
||||||
the `PORTS` column.
|
the `PORTS` column.
|
||||||
|
|
||||||
### <a name=size></a> Show disk usage by container (--size)
|
### <a name="size"></a> Show disk usage by container (--size)
|
||||||
|
|
||||||
The `docker ps --size` (or `-s`) command displays two different on-disk-sizes for each container:
|
The `docker ps --size` (or `-s`) command displays two different on-disk-sizes for each container:
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ e90b8831a4b8 nginx "/bin/bash -c 'mkdir " 11 weeks ago Up 4 hours
|
||||||
For more information, refer to the [container size on disk](https://docs.docker.com/storage/storagedriver/#container-size-on-disk) section.
|
For more information, refer to the [container size on disk](https://docs.docker.com/storage/storagedriver/#container-size-on-disk) section.
|
||||||
|
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The `--filter` (or `-f`) flag format is a `key=value` pair. If there is more
|
The `--filter` (or `-f`) flag format is a `key=value` pair. If there is more
|
||||||
than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`)
|
than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -394,7 +394,7 @@ $ docker ps --filter publish=80/udp
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty-prints container output using a Go
|
The formatting option (`--format`) pretty-prints container output using a Go
|
||||||
template.
|
template.
|
||||||
|
|
|
@ -188,7 +188,7 @@ registry is allowed to be accessed over an insecure connection. Refer to the
|
||||||
[insecure registries](dockerd.md#insecure-registries) section for more information.
|
[insecure registries](dockerd.md#insecure-registries) section for more information.
|
||||||
|
|
||||||
|
|
||||||
### <a name=all-tags></a> Pull a repository with multiple images (-a, --all-tags)
|
### <a name="all-tags"></a> Pull a repository with multiple images (-a, --all-tags)
|
||||||
|
|
||||||
By default, `docker pull` pulls a *single* image from the registry. A repository
|
By default, `docker pull` pulls a *single* image from the registry. A repository
|
||||||
can contain multiple images. To pull all images from a repository, provide the
|
can contain multiple images. To pull all images from a repository, provide the
|
||||||
|
|
|
@ -74,7 +74,7 @@ $ docker image ls
|
||||||
You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd`
|
You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd`
|
||||||
listed.
|
listed.
|
||||||
|
|
||||||
### <a name=all-tags></a> Push all tags of an image (-a, --all-tags)
|
### <a name="all-tags"></a> Push all tags of an image (-a, --all-tags)
|
||||||
|
|
||||||
Use the `-a` (or `--all-tags`) option to push all tags of a local image.
|
Use the `-a` (or `--all-tags`) option to push all tags of a local image.
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ $ docker rm /redis
|
||||||
/redis
|
/redis
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=link></a> Remove a link specified with `--link` on the default bridge network (--link)
|
### <a name="link"></a> Remove a link specified with `--link` on the default bridge network (--link)
|
||||||
|
|
||||||
This removes the underlying link between `/webapp` and the `/redis`
|
This removes the underlying link between `/webapp` and the `/redis`
|
||||||
containers on the default bridge network, removing all network communication
|
containers on the default bridge network, removing all network communication
|
||||||
|
@ -43,7 +43,7 @@ $ docker rm --link /webapp/redis
|
||||||
/webapp/redis
|
/webapp/redis
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=force></a> Force-remove a running container (--force)
|
### <a name="force"></a> Force-remove a running container (--force)
|
||||||
|
|
||||||
This command force-removes a running container.
|
This command force-removes a running container.
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ Or, using the `xargs` Linux utility;
|
||||||
$ docker ps --filter status=exited -q | xargs docker rm
|
$ docker ps --filter status=exited -q | xargs docker rm
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=volumes></a> Remove a container and its volumes (-v, --volumes)
|
### <a name="volumes"></a> Remove a container and its volumes (-v, --volumes)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker rm --volumes redis
|
$ docker rm --volumes redis
|
||||||
|
|
|
@ -157,7 +157,7 @@ For information on connecting a container to a network, see the ["*Docker networ
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### <a name=name></a> Assign name and allocate pseudo-TTY (--name, -it)
|
### <a name="name"></a> Assign name and allocate pseudo-TTY (--name, -it)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run --name test -it debian
|
$ docker run --name test -it debian
|
||||||
|
@ -176,7 +176,7 @@ In the example, the `bash` shell is quit by entering
|
||||||
`exit 13`. This exit code is passed on to the caller of
|
`exit 13`. This exit code is passed on to the caller of
|
||||||
`docker run`, and is recorded in the `test` container's metadata.
|
`docker run`, and is recorded in the `test` container's metadata.
|
||||||
|
|
||||||
### <a name=cidfile></a> Capture container ID (--cidfile)
|
### <a name="cidfile"></a> Capture container ID (--cidfile)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run --cidfile /tmp/docker_test.cid ubuntu echo "test"
|
$ docker run --cidfile /tmp/docker_test.cid ubuntu echo "test"
|
||||||
|
@ -187,7 +187,7 @@ flag makes Docker attempt to create a new file and write the container ID to it.
|
||||||
If the file exists already, Docker will return an error. Docker will close this
|
If the file exists already, Docker will return an error. Docker will close this
|
||||||
file when `docker run` exits.
|
file when `docker run` exits.
|
||||||
|
|
||||||
### <a name=privileged></a> Full container capabilities (--privileged)
|
### <a name="privileged"></a> Full container capabilities (--privileged)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -t -i --rm ubuntu bash
|
$ docker run -t -i --rm ubuntu bash
|
||||||
|
@ -212,7 +212,7 @@ lifts all the limitations enforced by the `device` cgroup controller. In other
|
||||||
words, the container can then do almost everything that the host can do. This
|
words, the container can then do almost everything that the host can do. This
|
||||||
flag exists to allow special use-cases, like running Docker within Docker.
|
flag exists to allow special use-cases, like running Docker within Docker.
|
||||||
|
|
||||||
### <a name=workdir></a> Set working directory (-w, --workdir)
|
### <a name="workdir"></a> Set working directory (-w, --workdir)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -w /path/to/dir/ -i -t ubuntu pwd
|
$ docker run -w /path/to/dir/ -i -t ubuntu pwd
|
||||||
|
@ -221,7 +221,7 @@ $ docker run -w /path/to/dir/ -i -t ubuntu pwd
|
||||||
The `-w` lets the command being executed inside directory given, here
|
The `-w` lets the command being executed inside directory given, here
|
||||||
`/path/to/dir/`. If the path does not exist it is created inside the container.
|
`/path/to/dir/`. If the path does not exist it is created inside the container.
|
||||||
|
|
||||||
### <a name=storage-opt></a> Set storage driver options per container (--storage-opt)
|
### <a name="storage-opt"></a> Set storage driver options per container (--storage-opt)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -it --storage-opt size=120G fedora /bin/bash
|
$ docker run -it --storage-opt size=120G fedora /bin/bash
|
||||||
|
@ -236,7 +236,7 @@ For the `overlay2` storage driver, the size option is only available if the
|
||||||
backing filesystem is `xfs` and mounted with the `pquota` mount option.
|
backing filesystem is `xfs` and mounted with the `pquota` mount option.
|
||||||
Under these conditions, user can pass any size less than the backing filesystem size.
|
Under these conditions, user can pass any size less than the backing filesystem size.
|
||||||
|
|
||||||
### <a name=tmpfs></a> Mount tmpfs (--tmpfs)
|
### <a name="tmpfs"></a> Mount tmpfs (--tmpfs)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image
|
$ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image
|
||||||
|
@ -245,7 +245,7 @@ $ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image
|
||||||
The `--tmpfs` flag mounts an empty tmpfs into the container with the `rw`,
|
The `--tmpfs` flag mounts an empty tmpfs into the container with the `rw`,
|
||||||
`noexec`, `nosuid`, `size=65536k` options.
|
`noexec`, `nosuid`, `size=65536k` options.
|
||||||
|
|
||||||
### <a name=volume></a> Mount volume (-v, --read-only)
|
### <a name="volume"></a> Mount volume (-v, --read-only)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -v `pwd`:`pwd` -w `pwd` -i -t ubuntu pwd
|
$ docker run -v `pwd`:`pwd` -w `pwd` -i -t ubuntu pwd
|
||||||
|
@ -311,7 +311,7 @@ docker run -v c:\foo:c:\existing-directory-with-contents ...
|
||||||
For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/storage/volumes/)
|
For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/storage/volumes/)
|
||||||
|
|
||||||
|
|
||||||
### <a name=mount></a> Add bind mounts or volumes using the --mount flag
|
### <a name="mount"></a> Add bind mounts or volumes using the --mount flag
|
||||||
|
|
||||||
The `--mount` flag allows you to mount volumes, host-directories and `tmpfs`
|
The `--mount` flag allows you to mount volumes, host-directories and `tmpfs`
|
||||||
mounts in a container.
|
mounts in a container.
|
||||||
|
@ -333,7 +333,7 @@ $ docker run --read-only --mount type=volume,target=/icanwrite busybox touch /ic
|
||||||
$ docker run -t -i --mount type=bind,src=/data,dst=/data busybox sh
|
$ docker run -t -i --mount type=bind,src=/data,dst=/data busybox sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=publish></a> Publish or expose port (-p, --expose)
|
### <a name="publish"></a> Publish or expose port (-p, --expose)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -p 127.0.0.1:80:8080/tcp ubuntu bash
|
$ docker run -p 127.0.0.1:80:8080/tcp ubuntu bash
|
||||||
|
@ -398,7 +398,7 @@ $ docker run --pull=never hello-world
|
||||||
docker: Error response from daemon: No such image: hello-world:latest.
|
docker: Error response from daemon: No such image: hello-world:latest.
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=env></a> Set environment variables (-e, --env, --env-file)
|
### <a name="env"></a> Set environment variables (-e, --env, --env-file)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
|
$ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
|
||||||
|
@ -449,7 +449,7 @@ VAR2=value2
|
||||||
USER=jonzeolla
|
USER=jonzeolla
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=label></a> Set metadata on container (-l, --label, --label-file)
|
### <a name="label"></a> Set metadata on container (-l, --label, --label-file)
|
||||||
|
|
||||||
A label is a `key=value` pair that applies metadata to a container. To label a container with two labels:
|
A label is a `key=value` pair that applies metadata to a container. To label a container with two labels:
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ For additional information on working with labels, see [*Labels - custom
|
||||||
metadata in Docker*](https://docs.docker.com/config/labels-custom-metadata/) in
|
metadata in Docker*](https://docs.docker.com/config/labels-custom-metadata/) in
|
||||||
the Docker User Guide.
|
the Docker User Guide.
|
||||||
|
|
||||||
### <a name=network></a> Connect a container to a network (--network)
|
### <a name="network"></a> Connect a container to a network (--network)
|
||||||
|
|
||||||
When you start a container use the `--network` flag to connect it to a network.
|
When you start a container use the `--network` flag to connect it to a network.
|
||||||
The following commands create a network named `my-net`, and adds a `busybox` container
|
The following commands create a network named `my-net`, and adds a `busybox` container
|
||||||
|
@ -526,7 +526,7 @@ from different Engines can also communicate in this way.
|
||||||
You can disconnect a container from a network using the `docker network
|
You can disconnect a container from a network using the `docker network
|
||||||
disconnect` command.
|
disconnect` command.
|
||||||
|
|
||||||
### <a name=volumes-from></a> Mount volumes from container (--volumes-from)
|
### <a name="volumes-from"></a> Mount volumes from container (--volumes-from)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd
|
$ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd
|
||||||
|
@ -552,7 +552,7 @@ content label. Shared volume labels allow all containers to read/write content.
|
||||||
The `Z` option tells Docker to label the content with a private unshared label.
|
The `Z` option tells Docker to label the content with a private unshared label.
|
||||||
Only the current container can use a private volume.
|
Only the current container can use a private volume.
|
||||||
|
|
||||||
### <a name=attach></a> Attach to STDIN/STDOUT/STDERR (-a, --attach)
|
### <a name="attach"></a> Attach to STDIN/STDOUT/STDERR (-a, --attach)
|
||||||
|
|
||||||
The `--attach` (or `-a`) flag tells `docker run` to bind to the container's
|
The `--attach` (or `-a`) flag tells `docker run` to bind to the container's
|
||||||
`STDIN`, `STDOUT` or `STDERR`. This makes it possible to manipulate the output
|
`STDIN`, `STDOUT` or `STDERR`. This makes it possible to manipulate the output
|
||||||
|
@ -585,7 +585,7 @@ retrieve the container's ID once the container has finished running.
|
||||||
|
|
||||||
See also [the `docker cp` command](cp.md).
|
See also [the `docker cp` command](cp.md).
|
||||||
|
|
||||||
### <a name=device></a> Add host device to container (--device)
|
### <a name="device"></a> Add host device to container (--device)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -it --rm \
|
$ docker run -it --rm \
|
||||||
|
@ -678,7 +678,7 @@ the required device when it is added.
|
||||||
> **Note**: initially present devices still need to be explicitly added to the
|
> **Note**: initially present devices still need to be explicitly added to the
|
||||||
> `docker run` / `docker create` command.
|
> `docker run` / `docker create` command.
|
||||||
|
|
||||||
### <a name=gpus></a> Access an NVIDIA GPU
|
### <a name="gpus"></a> Access an NVIDIA GPU
|
||||||
|
|
||||||
The `--gpus` flag allows you to access NVIDIA GPU resources. First you need to
|
The `--gpus` flag allows you to access NVIDIA GPU resources. First you need to
|
||||||
install [nvidia-container-runtime](https://nvidia.github.io/nvidia-container-runtime/).
|
install [nvidia-container-runtime](https://nvidia.github.io/nvidia-container-runtime/).
|
||||||
|
@ -705,7 +705,7 @@ The example below exposes the first and third GPUs.
|
||||||
$ docker run -it --rm --gpus '"device=0,2"' nvidia-smi
|
$ docker run -it --rm --gpus '"device=0,2"' nvidia-smi
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=restart></a> Restart policies (--restart)
|
### <a name="restart"></a> Restart policies (--restart)
|
||||||
|
|
||||||
Use Docker's `--restart` to specify a container's *restart policy*. A restart
|
Use Docker's `--restart` to specify a container's *restart policy*. A restart
|
||||||
policy controls whether the Docker daemon restarts a container after exit.
|
policy controls whether the Docker daemon restarts a container after exit.
|
||||||
|
@ -729,7 +729,7 @@ More detailed information on restart policies can be found in the
|
||||||
[Restart Policies (--restart)](../run.md#restart-policies---restart)
|
[Restart Policies (--restart)](../run.md#restart-policies---restart)
|
||||||
section of the Docker run reference page.
|
section of the Docker run reference page.
|
||||||
|
|
||||||
### <a name=add-host></a> Add entries to container hosts file (--add-host)
|
### <a name="add-host"></a> Add entries to container hosts file (--add-host)
|
||||||
|
|
||||||
You can add other hosts into a container's `/etc/hosts` file by using one or
|
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
|
more `--add-host` flags. This example adds a static address for a host named
|
||||||
|
@ -767,7 +767,7 @@ For IPv6 use the `-6` flag instead of the `-4` flag. For other network
|
||||||
devices, replace `eth0` with the correct device name (for example `docker0`
|
devices, replace `eth0` with the correct device name (for example `docker0`
|
||||||
for the bridge device).
|
for the bridge device).
|
||||||
|
|
||||||
### <a name=ulimit></a> Set ulimits in container (--ulimit)
|
### <a name="ulimit"></a> Set ulimits in container (--ulimit)
|
||||||
|
|
||||||
Since setting `ulimit` settings in a container requires extra privileges not
|
Since setting `ulimit` settings in a container requires extra privileges not
|
||||||
available in the default container, you can set these using the `--ulimit` flag.
|
available in the default container, you can set these using the `--ulimit` flag.
|
||||||
|
@ -813,7 +813,7 @@ The 4th container fails and reports "[8] System error: resource temporarily unav
|
||||||
This fails because the caller set `nproc=3` resulting in the first three containers using up
|
This fails because the caller set `nproc=3` resulting in the first three containers using up
|
||||||
the three processes quota set for the `daemon` user.
|
the three processes quota set for the `daemon` user.
|
||||||
|
|
||||||
### <a name=stop-signal></a> Stop container with signal (--stop-signal)
|
### <a name="stop-signal"></a> Stop container with signal (--stop-signal)
|
||||||
|
|
||||||
The `--stop-signal` flag sets the system call signal that will be sent to the
|
The `--stop-signal` flag sets the system call signal that will be sent to the
|
||||||
container to exit. This signal can be a signal name in the format `SIG<NAME>`,
|
container to exit. This signal can be a signal name in the format `SIG<NAME>`,
|
||||||
|
@ -822,12 +822,12 @@ kernel's syscall table, for instance `9`.
|
||||||
|
|
||||||
The default is `SIGTERM` if not specified.
|
The default is `SIGTERM` if not specified.
|
||||||
|
|
||||||
### <a name=security-opt></a> Optional security options (--security-opt)
|
### <a name="security-opt"></a> Optional security options (--security-opt)
|
||||||
|
|
||||||
On Windows, this flag can be used to specify the `credentialspec` option.
|
On Windows, this flag can be used to specify the `credentialspec` option.
|
||||||
The `credentialspec` must be in the format `file://spec.txt` or `registry://keyname`.
|
The `credentialspec` must be in the format `file://spec.txt` or `registry://keyname`.
|
||||||
|
|
||||||
### <a name=stop-timeout></a> Stop container with timeout (--stop-timeout)
|
### <a name="stop-timeout"></a> Stop container with timeout (--stop-timeout)
|
||||||
|
|
||||||
The `--stop-timeout` flag sets the number of seconds to wait for the container
|
The `--stop-timeout` flag sets the number of seconds to wait for the container
|
||||||
to stop after sending the pre-defined (see `--stop-signal`) system call signal.
|
to stop after sending the pre-defined (see `--stop-signal`) system call signal.
|
||||||
|
@ -840,7 +840,7 @@ wait indefinitely for the container to exit.
|
||||||
The default is determined by the daemon, and is 10 seconds for Linux containers,
|
The default is determined by the daemon, and is 10 seconds for Linux containers,
|
||||||
and 30 seconds for Windows containers.
|
and 30 seconds for Windows containers.
|
||||||
|
|
||||||
### <a name=isolation></a> Specify isolation technology for container (--isolation)
|
### <a name="isolation"></a> Specify isolation technology for container (--isolation)
|
||||||
|
|
||||||
This option is useful in situations where you are running Docker containers on
|
This option is useful in situations where you are running Docker containers on
|
||||||
Windows. The `--isolation=<value>` option sets a container's isolation technology.
|
Windows. The `--isolation=<value>` option sets a container's isolation technology.
|
||||||
|
@ -883,7 +883,7 @@ PS C:\> docker run -d --isolation default microsoft/nanoserver powershell echo h
|
||||||
PS C:\> docker run -d --isolation hyperv microsoft/nanoserver powershell echo hyperv
|
PS C:\> docker run -d --isolation hyperv microsoft/nanoserver powershell echo hyperv
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=memory></a> Specify hard limits on memory available to containers (-m, --memory)
|
### <a name="memory"></a> Specify hard limits on memory available to containers (-m, --memory)
|
||||||
|
|
||||||
These parameters always set an upper limit on the memory available to the container. On Linux, this
|
These parameters always set an upper limit on the memory available to the container. On Linux, this
|
||||||
is set on the cgroup and applications in a container can query it at `/sys/fs/cgroup/memory/memory.limit_in_bytes`.
|
is set on the cgroup and applications in a container can query it at `/sys/fs/cgroup/memory/memory.limit_in_bytes`.
|
||||||
|
@ -921,7 +921,7 @@ On Windows, this will affect containers differently depending on what type of is
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### <a name=sysctl></a> Configure namespaced kernel parameters (sysctls) at runtime (--sysctl)
|
### <a name="sysctl"></a> Configure namespaced kernel parameters (sysctls) at runtime (--sysctl)
|
||||||
|
|
||||||
The `--sysctl` sets namespaced kernel parameters (sysctls) in the
|
The `--sysctl` sets namespaced kernel parameters (sysctls) in the
|
||||||
container. For example, to turn on IP forwarding in the containers
|
container. For example, to turn on IP forwarding in the containers
|
||||||
|
|
|
@ -63,7 +63,7 @@ scottabernethy/busybox
|
||||||
marclop/busybox-solr
|
marclop/busybox-solr
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=no-trunc></a> Display non-truncated description (--no-trunc)
|
### <a name="no-trunc"></a> Display non-truncated description (--no-trunc)
|
||||||
|
|
||||||
This example displays images with a name containing 'busybox',
|
This example displays images with a name containing 'busybox',
|
||||||
at least 3 stars and the description isn't truncated in the output:
|
at least 3 stars and the description isn't truncated in the output:
|
||||||
|
@ -77,12 +77,12 @@ progrium/busybox
|
||||||
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK]
|
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=limit></a> Limit search results (--limit)
|
### <a name="limit"></a> Limit search results (--limit)
|
||||||
|
|
||||||
The flag `--limit` is the maximum number of results returned by a search. This value could
|
The flag `--limit` is the maximum number of results returned by a search. This value could
|
||||||
be in the range between 1 and 100. The default value of `--limit` is 25.
|
be in the range between 1 and 100. The default value of `--limit` is 25.
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
||||||
than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`)
|
than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`)
|
||||||
|
@ -132,7 +132,7 @@ NAME DESCRIPTION STARS OFFICIAL AUTOMATED
|
||||||
busybox Busybox base image. 325 [OK]
|
busybox Busybox base image. 325 [OK]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty-prints search output
|
The formatting option (`--format`) pretty-prints search output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -57,7 +57,7 @@ ID NAME CREATED UPDATED
|
||||||
dg426haahpi5ezmkkj5kyl3sn my_secret 7 seconds ago 7 seconds ago
|
dg426haahpi5ezmkkj5kyl3sn my_secret 7 seconds ago 7 seconds ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=label></a> Create a secret with labels (--label)
|
### <a name="label"></a> Create a secret with labels (--label)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker secret create \
|
$ docker secret create \
|
||||||
|
|
|
@ -76,7 +76,7 @@ The output is in JSON format, for example:
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
You can use the --format option to obtain specific information about a
|
You can use the --format option to obtain specific information about a
|
||||||
secret. The following example command outputs the creation time of the
|
secret. The following example command outputs the creation time of the
|
||||||
|
|
|
@ -45,7 +45,7 @@ ID NAME CREATED UPDA
|
||||||
mem02h8n73mybpgqjf0kfi1n0 test_secret 3 seconds ago 3 seconds ago
|
mem02h8n73mybpgqjf0kfi1n0 test_secret 3 seconds ago 3 seconds ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
||||||
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -105,7 +105,7 @@ ID NAME CREATED UPDA
|
||||||
mem02h8n73mybpgqjf0kfi1n0 test_secret About an hour ago About an hour ago
|
mem02h8n73mybpgqjf0kfi1n0 test_secret About an hour ago About an hour ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty prints secrets output
|
The formatting option (`--format`) pretty prints secrets output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -117,7 +117,7 @@ dmu1ept4cxcf redis replicated 1/1 redis:3.0.6
|
||||||
a8q9dasaafud redis2 global 1/1 redis:3.0.6
|
a8q9dasaafud redis2 global 1/1 redis:3.0.6
|
||||||
```
|
```
|
||||||
|
|
||||||
#### <a name=with-registry-auth></a>Create a service using an image on a private registry (--with-registry-auth)
|
#### <a name="with-registry-auth"></a> Create a service using an image on a private registry (--with-registry-auth)
|
||||||
|
|
||||||
If your image is available on a private registry which requires login, use the
|
If your image is available on a private registry which requires login, use the
|
||||||
`--with-registry-auth` flag with `docker service create`, after logging in. If
|
`--with-registry-auth` flag with `docker service create`, after logging in. If
|
||||||
|
@ -137,7 +137,7 @@ This passes the login token from your local client to the swarm nodes where the
|
||||||
service is deployed, using the encrypted WAL logs. With this information, the
|
service is deployed, using the encrypted WAL logs. With this information, the
|
||||||
nodes are able to log into the registry and pull the image.
|
nodes are able to log into the registry and pull the image.
|
||||||
|
|
||||||
### <a name=replicas></a>Create a service with 5 replica tasks (--replicas)
|
### <a name="replicas"></a> Create a service with 5 replica tasks (--replicas)
|
||||||
|
|
||||||
Use the `--replicas` flag to set the number of replica tasks for a replicated
|
Use the `--replicas` flag to set the number of replica tasks for a replicated
|
||||||
service. The following command creates a `redis` service with `5` replica tasks:
|
service. The following command creates a `redis` service with `5` replica tasks:
|
||||||
|
@ -173,7 +173,7 @@ ID NAME MODE REPLICAS IMAGE
|
||||||
4cdgfyky7ozw redis replicated 5/5 redis:3.0.7
|
4cdgfyky7ozw redis replicated 5/5 redis:3.0.7
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=secret></a>Create a service with secrets (--secret)
|
### <a name="secret"></a> Create a service with secrets (--secret)
|
||||||
|
|
||||||
Use the `--secret` flag to give a container access to a
|
Use the `--secret` flag to give a container access to a
|
||||||
[secret](secret_create.md).
|
[secret](secret_create.md).
|
||||||
|
@ -205,7 +205,7 @@ in the container. If a target is specified, that is used as the filename. In the
|
||||||
example above, two files are created: `/run/secrets/ssh` and
|
example above, two files are created: `/run/secrets/ssh` and
|
||||||
`/run/secrets/app` for each of the secret targets specified.
|
`/run/secrets/app` for each of the secret targets specified.
|
||||||
|
|
||||||
### <a name=config></a>Create a service with configs (--config)
|
### <a name="config"></a> Create a service with configs (--config)
|
||||||
|
|
||||||
Use the `--config` flag to give a container access to a
|
Use the `--config` flag to give a container access to a
|
||||||
[config](config_create.md).
|
[config](config_create.md).
|
||||||
|
@ -234,7 +234,7 @@ Configs are located in `/` in the container if no target is specified. If no
|
||||||
target is specified, the name of the config is used as the name of the file in
|
target is specified, the name of the config is used as the name of the file in
|
||||||
the container. If a target is specified, that is used as the filename.
|
the container. If a target is specified, that is used as the filename.
|
||||||
|
|
||||||
### <a name=update-delay></a>Create a service with a rolling update policy
|
### <a name="update-delay"></a> Create a service with a rolling update policy
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker service create \
|
$ docker service create \
|
||||||
|
@ -250,7 +250,7 @@ maximum of 2 tasks at a time, with `10s` between updates. For more information,
|
||||||
refer to the [rolling updates
|
refer to the [rolling updates
|
||||||
tutorial](https://docs.docker.com/engine/swarm/swarm-tutorial/rolling-update/).
|
tutorial](https://docs.docker.com/engine/swarm/swarm-tutorial/rolling-update/).
|
||||||
|
|
||||||
### <a name=env></a> Set environment variables (-e, --env)
|
### <a name="env"></a> Set environment variables (-e, --env)
|
||||||
|
|
||||||
This sets an environment variable for all tasks in a service. For example:
|
This sets an environment variable for all tasks in a service. For example:
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ $ docker service create \
|
||||||
redis:3.0.6
|
redis:3.0.6
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=hostname></a> Create a service with specific hostname (--hostname)
|
### <a name="hostname"></a> Create a service with specific hostname (--hostname)
|
||||||
|
|
||||||
This option sets the docker service containers hostname to a specific string.
|
This option sets the docker service containers hostname to a specific string.
|
||||||
For example:
|
For example:
|
||||||
|
@ -283,7 +283,7 @@ For example:
|
||||||
$ docker service create --name redis --hostname myredis redis:3.0.6
|
$ docker service create --name redis --hostname myredis redis:3.0.6
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=label></a> Set metadata on a service (-l, --label)
|
### <a name="label"></a> Set metadata on a service (-l, --label)
|
||||||
|
|
||||||
A label is a `key=value` pair that applies metadata to a service. To label a
|
A label is a `key=value` pair that applies metadata to a service. To label a
|
||||||
service with two labels:
|
service with two labels:
|
||||||
|
@ -299,7 +299,7 @@ $ docker service create \
|
||||||
For more information about labels, refer to [apply custom
|
For more information about labels, refer to [apply custom
|
||||||
metadata](https://docs.docker.com/config/labels-custom-metadata/).
|
metadata](https://docs.docker.com/config/labels-custom-metadata/).
|
||||||
|
|
||||||
### <a name=mount></a> Add bind mounts, volumes or memory filesystems (--mount)
|
### <a name="mount"></a> Add bind mounts, volumes or memory filesystems (--mount)
|
||||||
|
|
||||||
Docker supports three different kinds of mounts, which allow containers to read
|
Docker supports three different kinds of mounts, which allow containers to read
|
||||||
from or write to files or directories, either on the host operating system, or
|
from or write to files or directories, either on the host operating system, or
|
||||||
|
@ -662,7 +662,7 @@ $ docker service create \
|
||||||
redis:3.0.6
|
redis:3.0.6
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=constraint></a> Specify service constraints (--constraint)
|
### <a name="constraint"></a> Specify service constraints (--constraint)
|
||||||
|
|
||||||
You can limit the set of nodes where a task can be scheduled by defining
|
You can limit the set of nodes where a task can be scheduled by defining
|
||||||
constraint expressions. Constraint expressions can either use a _match_ (`==`)
|
constraint expressions. Constraint expressions can either use a _match_ (`==`)
|
||||||
|
@ -729,7 +729,7 @@ ID NAME MODE REPLICAS IMAGE PORTS
|
||||||
b6lww17hrr4e web replicated 1/1 nginx:alpine
|
b6lww17hrr4e web replicated 1/1 nginx:alpine
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=placement-pref></a> Specify service placement preferences (--placement-pref)
|
### <a name="placement-pref"></a> Specify service placement preferences (--placement-pref)
|
||||||
|
|
||||||
You can set up the service to divide tasks evenly over different categories of
|
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
|
nodes. One example of where this can be useful is to balance tasks over a set
|
||||||
|
@ -800,7 +800,7 @@ appends a new placement preference after all existing placement preferences.
|
||||||
`--placement-pref-rm` removes an existing placement preference that matches the
|
`--placement-pref-rm` removes an existing placement preference that matches the
|
||||||
argument.
|
argument.
|
||||||
|
|
||||||
### <a name=reserve-memory></a> Specify memory requirements and constraints for a service (--reserve-memory and --limit-memory)
|
### <a name="reserve-memory"></a> Specify memory requirements and constraints for a service (--reserve-memory and --limit-memory)
|
||||||
|
|
||||||
If your service needs a minimum amount of memory in order to run correctly,
|
If your service needs a minimum amount of memory in order to run correctly,
|
||||||
you can use `--reserve-memory` to specify that the service should only be
|
you can use `--reserve-memory` to specify that the service should only be
|
||||||
|
@ -868,7 +868,7 @@ On Linux, you can also limit a service's overall memory footprint on a given
|
||||||
host at the level of the host operating system, using `cgroups` or other
|
host at the level of the host operating system, using `cgroups` or other
|
||||||
relevant operating system tools.
|
relevant operating system tools.
|
||||||
|
|
||||||
### <a name=replicas-max-per-node></a> Specify maximum replicas per node (--replicas-max-per-node)
|
### <a name="replicas-max-per-node"></a> Specify maximum replicas per node (--replicas-max-per-node)
|
||||||
|
|
||||||
Use the `--replicas-max-per-node` flag to set the maximum number of replica tasks that can run on a node.
|
Use the `--replicas-max-per-node` flag to set the maximum number of replica tasks that can run on a node.
|
||||||
The following command creates a nginx service with 2 replica tasks but only one replica task per node.
|
The following command creates a nginx service with 2 replica tasks but only one replica task per node.
|
||||||
|
@ -888,7 +888,7 @@ $ docker service create \
|
||||||
nginx
|
nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=network></a> Attach a service to an existing network (--network)
|
### <a name="network"></a> Attach a service to an existing network (--network)
|
||||||
|
|
||||||
You can use overlay networks to connect one or more services within the swarm.
|
You can use overlay networks to connect one or more services within the swarm.
|
||||||
|
|
||||||
|
@ -925,7 +925,7 @@ Containers on the same network can access each other using
|
||||||
Long form syntax of `--network` allows to specify list of aliases and driver options:
|
Long form syntax of `--network` allows to specify list of aliases and driver options:
|
||||||
`--network name=my-network,alias=web1,driver-opt=field1=value1`
|
`--network name=my-network,alias=web1,driver-opt=field1=value1`
|
||||||
|
|
||||||
### <a name=publish></a> Publish service ports externally to the swarm (-p, --publish)
|
### <a name="publish"></a> Publish service ports externally to the swarm (-p, --publish)
|
||||||
|
|
||||||
You can publish service ports to make them available externally to the swarm
|
You can publish service ports to make them available externally to the swarm
|
||||||
using the `--publish` flag. The `--publish` flag can take two different styles
|
using the `--publish` flag. The `--publish` flag can take two different styles
|
||||||
|
@ -996,7 +996,7 @@ on a node can only be bound once. You can only set the publication mode using
|
||||||
the long syntax. For more information refer to
|
the long syntax. For more information refer to
|
||||||
[Use swarm mode routing mesh](https://docs.docker.com/engine/swarm/ingress/).
|
[Use swarm mode routing mesh](https://docs.docker.com/engine/swarm/ingress/).
|
||||||
|
|
||||||
### <a name=credentials-spec></a> Provide credential specs for managed service accounts (--credentials-spec)
|
### <a name="credentials-spec"></a> Provide credential specs for managed service accounts (--credentials-spec)
|
||||||
|
|
||||||
This option is only used for services using Windows containers. The
|
This option is only used for services using Windows containers. The
|
||||||
`--credential-spec` must be in the format `file://<filename>` or
|
`--credential-spec` must be in the format `file://<filename>` or
|
||||||
|
@ -1091,7 +1091,7 @@ $ docker inspect --format="{{.Config.Hostname}}" 2e7a8a9c4da2-wo41w8hg8qanxwjwsg
|
||||||
x3ti0erg11rjpg64m75kej2mz-hosttempl
|
x3ti0erg11rjpg64m75kej2mz-hosttempl
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=isolation></a> Specify isolation mode on Windows (--isolation)
|
### <a name="isolation"></a> Specify isolation mode on Windows (--isolation)
|
||||||
|
|
||||||
By default, tasks scheduled on Windows nodes are run using the default isolation mode
|
By default, tasks scheduled on Windows nodes are run using the default isolation mode
|
||||||
configured for this particular node. To force a specific isolation mode, you can use
|
configured for this particular node. To force a specific isolation mode, you can use
|
||||||
|
@ -1106,7 +1106,7 @@ Supported isolation modes on Windows are:
|
||||||
- `process`: use process isolation (Windows server only)
|
- `process`: use process isolation (Windows server only)
|
||||||
- `hyperv`: use Hyper-V isolation
|
- `hyperv`: use Hyper-V isolation
|
||||||
|
|
||||||
### <a name=generic-resources></a> Create services requesting Generic Resources (--generic-resources)
|
### <a name="generic-resources"></a> Create services requesting Generic Resources (--generic-resources)
|
||||||
|
|
||||||
You can narrow the kind of nodes your task can land on through the using the
|
You can narrow the kind of nodes your task can land on through the using the
|
||||||
`--generic-resource` flag (if the nodes advertise these resources):
|
`--generic-resource` flag (if the nodes advertise these resources):
|
||||||
|
|
|
@ -113,7 +113,7 @@ $ docker service inspect dmu1ept4cxcf
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=pretty></a> Formatting (--pretty)
|
### <a name="pretty"></a> Formatting (--pretty)
|
||||||
|
|
||||||
You can print the inspect output in a human-readable format instead of the default
|
You can print the inspect output in a human-readable format instead of the default
|
||||||
JSON output, by using the `--pretty` option:
|
JSON output, by using the `--pretty` option:
|
||||||
|
@ -146,7 +146,7 @@ Ports:
|
||||||
|
|
||||||
You can also use `--format pretty` for the same effect.
|
You can also use `--format pretty` for the same effect.
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
You can use the --format option to obtain specific information about a
|
You can use the --format option to obtain specific information about a
|
||||||
The `--format` option can be used to obtain specific information about a
|
The `--format` option can be used to obtain specific information about a
|
||||||
|
|
|
@ -51,7 +51,7 @@ the service. If the service is in `replicated-job` or `global-job`, it will
|
||||||
additionally show the completion status of the job as completed tasks over
|
additionally show the completion status of the job as completed tasks over
|
||||||
total tasks the job will execute.
|
total tasks the job will execute.
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
|
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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -123,7 +123,7 @@ ID NAME MODE REPLICAS IMAGE
|
||||||
0bcjwfh8ychr redis replicated 1/1 redis:3.0.6
|
0bcjwfh8ychr redis replicated 1/1 redis:3.0.6
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints services output
|
The formatting options (`--format`) pretty-prints services output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -93,7 +93,7 @@ bk658fpbex0d57cqcwoe3jthu redis.2 redis:3.0.6@sha256:6a692a76c2081888b589
|
||||||
nvjljf7rmor4htv7l8rwcx7i7 \_ redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Shutdown Rejected 5 minutes ago "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842"
|
nvjljf7rmor4htv7l8rwcx7i7 \_ redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Shutdown Rejected 5 minutes ago "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842"
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
||||||
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
||||||
|
@ -150,7 +150,7 @@ ID NAME IMAGE NODE DESIRED STATE CURRENT STATE
|
||||||
|
|
||||||
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
|
The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`.
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints tasks output
|
The formatting options (`--format`) pretty-prints tasks output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -131,7 +131,7 @@ rolling restart without any changes to the service parameters.
|
||||||
$ docker service update --limit-cpu 2 redis
|
$ docker service update --limit-cpu 2 redis
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=update-parallelism></a> Perform a rolling restart with no parameter changes
|
### <a name="update-parallelism"></a> Perform a rolling restart with no parameter changes
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker service update --force --update-parallelism 1 --update-delay 30s redis
|
$ docker service update --force --update-parallelism 1 --update-delay 30s redis
|
||||||
|
@ -144,7 +144,7 @@ that only one task is replaced at a time (this is the default behavior). The
|
||||||
`--update-delay 30s` setting introduces a 30 second delay between tasks, so
|
`--update-delay 30s` setting introduces a 30 second delay between tasks, so
|
||||||
that the rolling restart happens gradually.
|
that the rolling restart happens gradually.
|
||||||
|
|
||||||
### <a name=mount-add></a> Add or remove mounts (--mount-add, --mount-rm)
|
### <a name="mount-add"></a> Add or remove mounts (--mount-add, --mount-rm)
|
||||||
|
|
||||||
Use the `--mount-add` or `--mount-rm` options add or remove a service's bind mounts
|
Use the `--mount-add` or `--mount-rm` options add or remove a service's bind mounts
|
||||||
or volumes.
|
or volumes.
|
||||||
|
@ -180,7 +180,7 @@ $ docker service update --mount-rm /somewhere myservice
|
||||||
myservice
|
myservice
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=publish-add></a> Add or remove published service ports (--publish-add, --publish-rm)
|
### <a name="publish-add"></a> Add or remove published service ports (--publish-add, --publish-rm)
|
||||||
|
|
||||||
Use the `--publish-add` or `--publish-rm` flags to add or remove a published
|
Use the `--publish-add` or `--publish-rm` flags to add or remove a published
|
||||||
port for a service. You can use the short or long syntax discussed in the
|
port for a service. You can use the short or long syntax discussed in the
|
||||||
|
@ -195,7 +195,7 @@ $ docker service update \
|
||||||
myservice
|
myservice
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=network-add></a> Add or remove network (--network-add, --network-rm)
|
### <a name="network-add"></a> Add or remove network (--network-add, --network-rm)
|
||||||
|
|
||||||
Use the `--network-add` or `--network-rm` flags to add or remove a network for
|
Use the `--network-add` or `--network-rm` flags to add or remove a network for
|
||||||
a service. You can use the short or long syntax discussed in the
|
a service. You can use the short or long syntax discussed in the
|
||||||
|
@ -211,7 +211,7 @@ $ docker service update \
|
||||||
myservice
|
myservice
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=rollback></a> Roll back to the previous version of a service (--rollback)
|
### <a name="rollback"></a> Roll back to the previous version of a service (--rollback)
|
||||||
|
|
||||||
Use the `--rollback` option to roll back to the previous version of the service.
|
Use the `--rollback` option to roll back to the previous version of the service.
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ will update one task at a time during a normal update, but during a rollback, 3
|
||||||
tasks at a time will get rolled back. These rollback parameters are respected both
|
tasks at a time will get rolled back. These rollback parameters are respected both
|
||||||
during automatic rollbacks and for rollbacks initiated manually using `--rollback`.
|
during automatic rollbacks and for rollbacks initiated manually using `--rollback`.
|
||||||
|
|
||||||
### <a name=secret-add></a> Add or remove secrets (--secret-add, --secret-rm)
|
### <a name="secret-add"></a> Add or remove secrets (--secret-add, --secret-rm)
|
||||||
|
|
||||||
Use the `--secret-add` or `--secret-rm` options add or remove a service's
|
Use the `--secret-add` or `--secret-rm` options add or remove a service's
|
||||||
secrets.
|
secrets.
|
||||||
|
@ -297,7 +297,7 @@ Some flags of `service update` support the use of templating.
|
||||||
See [`service create`](service_create.md#create-services-using-templates) for the reference.
|
See [`service create`](service_create.md#create-services-using-templates) for the reference.
|
||||||
|
|
||||||
|
|
||||||
### <a name=isolation></a> Specify isolation mode on Windows (--isolation)
|
### <a name="isolation"></a> Specify isolation mode on Windows (--isolation)
|
||||||
|
|
||||||
`service update` supports the same `--isolation` flag as `service create`
|
`service update` supports the same `--isolation` flag as `service create`
|
||||||
See [`service create`](service_create.md) for the reference.
|
See [`service create`](service_create.md) for the reference.
|
||||||
|
|
|
@ -39,7 +39,7 @@ Create and update a stack from a `compose` file on the swarm.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### <a name=compose-file></a> Compose file (--compose-file)
|
### <a name="compose-file"></a> Compose file (--compose-file)
|
||||||
|
|
||||||
The `deploy` command supports compose file version `3.0` and above.
|
The `deploy` command supports compose file version `3.0` and above.
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ myapp 2 Kubernetes
|
||||||
vossibility-stack 6 Swarm
|
vossibility-stack 6 Swarm
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty-prints stacks using a Go template.
|
The formatting option (`--format`) pretty-prints stacks using a Go template.
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ kqgdmededccb voting_vote.2 dockersamples/examplevotingapp_vote:be
|
||||||
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 3 minutes ago
|
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 3 minutes ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
||||||
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
||||||
|
@ -123,7 +123,7 @@ kqgdmededccb voting_vote.2 dockersamples/examplevotingapp_vote:be
|
||||||
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 21 minutes ago
|
t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 21 minutes ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints tasks output using a Go template.
|
The formatting options (`--format`) pretty-prints tasks output using a Go template.
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ voting_vote.2: dockersamples/examplevotingapp_vote:before
|
||||||
voting_redis.2: redis:alpine
|
voting_redis.2: redis:alpine
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=no-resolve></a> Do not map IDs to Names (--no-resolve)
|
### <a name="no-resolve"></a> Do not map IDs to Names (--no-resolve)
|
||||||
|
|
||||||
The `--no-resolve` option shows IDs for task name, without mapping IDs to Names.
|
The `--no-resolve` option shows IDs for task name, without mapping IDs to Names.
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ kqgdmededccb qyprtqw1g5nrki557i974ou1d.2 dockersamples/examplevotingapp
|
||||||
t72q3z038jeh tg61x8myx563ueo3urmn1ic6m.2 redis:alpine kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago
|
t72q3z038jeh tg61x8myx563ueo3urmn1ic6m.2 redis:alpine kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=no-trunc></a> Do not truncate output (--no-trunc)
|
### <a name="no-trunc"></a> Do not truncate output (--no-trunc)
|
||||||
|
|
||||||
When deploying a service, docker resolves the digest for the service's
|
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
|
image, and pins the service to that digest. The digest is not shown by
|
||||||
|
@ -199,7 +199,7 @@ kqgdmededccbhz2wuc0e9hx7g voting_vote.2 dockersamples/examplevotingapp
|
||||||
t72q3z038jehe1wbh9gdum076 voting_redis.2 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node3 Running Runnin 32 minutes ago
|
t72q3z038jehe1wbh9gdum076 voting_redis.2 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node3 Running Runnin 32 minutes ago
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=quiet></a> Only display task IDs (-q, --quiet)
|
### <a name="quiet"></a> Only display task IDs (-q, --quiet)
|
||||||
|
|
||||||
The `-q ` or `--quiet` option only shows IDs of the tasks in the stack.
|
The `-q ` or `--quiet` option only shows IDs of the tasks in the stack.
|
||||||
This example outputs all task IDs of the "voting" stack;
|
This example outputs all task IDs of the "voting" stack;
|
||||||
|
|
|
@ -44,7 +44,7 @@ ID NAME REPLICAS IMAGE
|
||||||
dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539
|
dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there
|
||||||
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`).
|
||||||
|
@ -81,7 +81,7 @@ The currently supported filters are:
|
||||||
* Swarm: not supported
|
* Swarm: not supported
|
||||||
* Kubernetes: supported
|
* Kubernetes: supported
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints services output
|
The formatting options (`--format`) pretty-prints services output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -131,7 +131,7 @@ CONTAINER ID NAME CPU % PRIV WORKING SET
|
||||||
9db7aa4d986d mad_wilson 9.59% 40.09 MiB 27.6 kB / 8.81 kB 17 MB / 20.1 MB
|
9db7aa4d986d mad_wilson 9.59% 40.09 MiB 27.6 kB / 8.81 kB 17 MB / 20.1 MB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty prints container output
|
The formatting option (`--format`) pretty prints container output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -83,7 +83,7 @@ gyg5u9Iliel99l7SuMhNeLkrU7fXs+Of1nTyyM73ig==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=rotate></a> Root CA rotation (--rotate)
|
### <a name="rotate"></a> Root CA rotation (--rotate)
|
||||||
|
|
||||||
Root CA Rotation is recommended if one or more of the swarm managers have been
|
Root CA Rotation is recommended if one or more of the swarm managers have been
|
||||||
compromised, so that those managers can no longer connect to or be trusted by
|
compromised, so that those managers can no longer connect to or be trusted by
|
||||||
|
@ -106,7 +106,7 @@ reasonable amount of time, try running
|
||||||
see if any nodes are down or otherwise unable to rotate TLS certificates.
|
see if any nodes are down or otherwise unable to rotate TLS certificates.
|
||||||
|
|
||||||
|
|
||||||
### <a name=detach></a> Run root CA rotation in detached mode (--detach)
|
### <a name="detach"></a> Run root CA rotation in detached mode (--detach)
|
||||||
|
|
||||||
Initiate the root CA rotation, but do not wait for the completion of or display the
|
Initiate the root CA rotation, but do not wait for the completion of or display the
|
||||||
progress of the rotation.
|
progress of the rotation.
|
||||||
|
|
|
@ -79,7 +79,7 @@ volumes or in systems where some images, containers, or volumes have very large
|
||||||
filesystems with many files. You should also be careful not to run this command
|
filesystems with many files. You should also be careful not to run this command
|
||||||
in systems where performance is critical.
|
in systems where performance is critical.
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty prints the disk usage output
|
The formatting option (`--format`) pretty prints the disk usage output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -118,7 +118,7 @@ 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
|
seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
|
||||||
fraction of a second no more than nine digits long.
|
fraction of a second no more than nine digits long.
|
||||||
|
|
||||||
#### <a name=filter></a> Filtering (--filter)
|
#### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If you would
|
The filtering flag (`-f` or `--filter`) format is of "key=value". If you would
|
||||||
like to use multiple filters, pass multiple flags (e.g.,
|
like to use multiple filters, pass multiple flags (e.g.,
|
||||||
|
@ -305,7 +305,7 @@ $ docker system events --filter 'type=plugin'
|
||||||
2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
|
2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
If a format (`--format`) is specified, the given template will be executed
|
If a format (`--format`) is specified, the given template will be executed
|
||||||
instead of the default format. Go's [text/template](https://golang.org/pkg/text/template/)
|
instead of the default format. Go's [text/template](https://golang.org/pkg/text/template/)
|
||||||
|
|
|
@ -97,7 +97,7 @@ deleted: sha256:3a88a5c81eb5c283e72db2dbc6d65cbfd8e80b6c89bb6e714cfaaa0eed99c548
|
||||||
Total reclaimed space: 13.5 MB
|
Total reclaimed space: 13.5 MB
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`--filter`) format is of "key=value". If there is more
|
The filtering flag (`--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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
|
|
@ -53,7 +53,7 @@ a running container with kernel memory initialized.
|
||||||
|
|
||||||
The following sections illustrate ways to use this command.
|
The following sections illustrate ways to use this command.
|
||||||
|
|
||||||
### <a name=cpu-shares></a> Update a container's cpu-shares (--cpu-shares)
|
### <a name="cpu-shares"></a> Update a container's cpu-shares (--cpu-shares)
|
||||||
|
|
||||||
To limit a container's cpu-shares to 512, first identify the container
|
To limit a container's cpu-shares to 512, first identify the container
|
||||||
name or ID. You can use `docker ps` to find these values. You can also
|
name or ID. You can use `docker ps` to find these values. You can also
|
||||||
|
@ -63,7 +63,7 @@ use the ID returned from the `docker run` command. Then, do the following:
|
||||||
$ docker update --cpu-shares 512 abebf7571666
|
$ docker update --cpu-shares 512 abebf7571666
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=memory></a> Update a container with cpu-shares and memory (-m, --memory)
|
### <a name="memory"></a> Update a container with cpu-shares and memory (-m, --memory)
|
||||||
|
|
||||||
To update multiple resource configurations for multiple containers:
|
To update multiple resource configurations for multiple containers:
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ To update multiple resource configurations for multiple containers:
|
||||||
$ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse
|
$ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=kernel-memory></a> Update a container's kernel memory constraints (--kernel-memory)
|
### <a name="kernel-memory"></a> Update a container's kernel memory constraints (--kernel-memory)
|
||||||
|
|
||||||
You can update a container's kernel memory limit using the `--kernel-memory`
|
You can update a container's kernel memory limit using the `--kernel-memory`
|
||||||
option. On kernel version older than 4.6, this option can be updated on a
|
option. On kernel version older than 4.6, this option can be updated on a
|
||||||
|
@ -108,7 +108,7 @@ start it, the container uses the new value.
|
||||||
Kernel version newer than (include) 4.6 does not have this limitation, you
|
Kernel version newer than (include) 4.6 does not have this limitation, you
|
||||||
can use `--kernel-memory` the same way as other options.
|
can use `--kernel-memory` the same way as other options.
|
||||||
|
|
||||||
### <a name=restart></a> Update a container's restart policy (--restart)
|
### <a name="restart"></a> Update a container's restart policy (--restart)
|
||||||
|
|
||||||
You can change a container's restart policy on a running container. The new
|
You can change a container's restart policy on a running container. The new
|
||||||
restart policy takes effect instantly after you run `docker update` on a
|
restart policy takes effect instantly after you run `docker update` on a
|
||||||
|
|
|
@ -117,7 +117,7 @@ Server: Docker Engine - Community
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting option (`--format`) pretty-prints the output using a Go template,
|
The formatting option (`--format`) pretty-prints the output using a Go template,
|
||||||
which allows you to customize the output format, or to obtain specific information
|
which allows you to customize the output format, or to obtain specific information
|
||||||
|
|
|
@ -53,7 +53,7 @@ A volume named "hello" already exists with the "some-other" driver. Choose a d
|
||||||
If you specify a volume name already in use on the current driver, Docker
|
If you specify a volume name already in use on the current driver, Docker
|
||||||
assumes you want to re-use the existing volume and does not return an error.
|
assumes you want to re-use the existing volume and does not return an error.
|
||||||
|
|
||||||
### <a name=opt></a> Driver-specific options (-o, --opt)
|
### <a name="opt"></a> Driver-specific options (-o, --opt)
|
||||||
|
|
||||||
Some volume drivers may take options to customize the volume creation. Use the
|
Some volume drivers may take options to customize the volume creation. Use the
|
||||||
`-o` or `--opt` flags to pass driver options:
|
`-o` or `--opt` flags to pass driver options:
|
||||||
|
|
|
@ -54,7 +54,7 @@ The output is in JSON format, for example:
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
Use the `--format` flag to format the output using a Go template, for example,
|
Use the `--format` flag to format the output using a Go template, for example,
|
||||||
to print the `Mountpoint` property:
|
to print the `Mountpoint` property:
|
||||||
|
|
|
@ -51,7 +51,7 @@ local rosemary
|
||||||
local tyler
|
local tyler
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
|
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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
@ -151,7 +151,7 @@ DRIVER VOLUME NAME
|
||||||
local rosemary
|
local rosemary
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=format></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|
||||||
The formatting options (`--format`) pretty-prints volumes output
|
The formatting options (`--format`) pretty-prints volumes output
|
||||||
using a Go template.
|
using a Go template.
|
||||||
|
|
|
@ -35,7 +35,7 @@ my-named-vol
|
||||||
Total reclaimed space: 36 B
|
Total reclaimed space: 36 B
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name=filter></a> Filtering (--filter)
|
### <a name="filter"></a> Filtering (--filter)
|
||||||
|
|
||||||
The filtering flag (`--filter`) format is of "key=value". If there is more
|
The filtering flag (`--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"`)
|
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
|
||||||
|
|
Loading…
Reference in New Issue