mirror of
https://github.com/docker/cli.git
synced 2026-11-13 00:04:00 -04:00
Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29cf629222 | ||
|
|
4caf4de039 | ||
|
|
950ecd42fd | ||
|
|
6ab4781bd0 | ||
|
|
e8852e8ed2 | ||
|
|
4e097c643d | ||
|
|
01f9332618 | ||
|
|
4cd8d5cf47 | ||
|
|
21c12847bf | ||
|
|
22e1f2cbfa | ||
|
|
68abf14c15 | ||
|
|
85a5ee4cb0 | ||
|
|
9e1e07657a |
+1
-1
@@ -9,7 +9,7 @@ ARG XX_VERSION=1.2.1
|
|||||||
ARG GOVERSIONINFO_VERSION=v1.3.0
|
ARG GOVERSIONINFO_VERSION=v1.3.0
|
||||||
ARG GOTESTSUM_VERSION=v1.10.0
|
ARG GOTESTSUM_VERSION=v1.10.0
|
||||||
ARG BUILDX_VERSION=0.12.1
|
ARG BUILDX_VERSION=0.12.1
|
||||||
ARG COMPOSE_VERSION=v2.24.0
|
ARG COMPOSE_VERSION=v2.24.2
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ func ConnectAndWait(cb func()) {
|
|||||||
_, err := conn.Read(b)
|
_, err := conn.Read(b)
|
||||||
if errors.Is(err, io.EOF) {
|
if errors.Is(err, io.EOF) {
|
||||||
cb()
|
cb()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -10,105 +10,8 @@ aliases:
|
|||||||
- /engine/reference/commandline/engine_update/
|
- /engine/reference/commandline/engine_update/
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- This file is maintained within the docker/cli GitHub
|
The base command for the Docker CLI is `docker`. For information about the
|
||||||
repository at https://github.com/docker/cli/. Make all
|
available flags and subcommands, refer to the [CLI reference](docker.md)
|
||||||
pull requests against that repo. If you see this file in
|
|
||||||
another repository, consider it read-only there, as it will
|
|
||||||
periodically be overwritten by the definitive file. Pull
|
|
||||||
requests which include edits to this file in other repositories
|
|
||||||
will be rejected.
|
|
||||||
-->
|
|
||||||
|
|
||||||
# docker
|
|
||||||
|
|
||||||
To list available commands, either run `docker` with no parameters
|
|
||||||
or execute `docker help`:
|
|
||||||
|
|
||||||
<!---MARKER_GEN_START-->
|
|
||||||
The base command for the Docker CLI.
|
|
||||||
|
|
||||||
### Subcommands
|
|
||||||
|
|
||||||
| Name | Description |
|
|
||||||
|:------------------------------|:------------------------------------------------------------------------------|
|
|
||||||
| [`attach`](attach.md) | Attach local standard input, output, and error streams to a running container |
|
|
||||||
| [`build`](build.md) | Build an image from a Dockerfile |
|
|
||||||
| [`builder`](builder.md) | Manage builds |
|
|
||||||
| [`checkpoint`](checkpoint.md) | Manage checkpoints |
|
|
||||||
| [`commit`](commit.md) | Create a new image from a container's changes |
|
|
||||||
| [`config`](config.md) | Manage Swarm configs |
|
|
||||||
| [`container`](container.md) | Manage containers |
|
|
||||||
| [`context`](context.md) | Manage contexts |
|
|
||||||
| [`cp`](cp.md) | Copy files/folders between a container and the local filesystem |
|
|
||||||
| [`create`](create.md) | Create a new container |
|
|
||||||
| [`diff`](diff.md) | Inspect changes to files or directories on a container's filesystem |
|
|
||||||
| [`events`](events.md) | Get real time events from the server |
|
|
||||||
| [`exec`](exec.md) | Execute a command in a running container |
|
|
||||||
| [`export`](export.md) | Export a container's filesystem as a tar archive |
|
|
||||||
| [`history`](history.md) | Show the history of an image |
|
|
||||||
| [`image`](image.md) | Manage images |
|
|
||||||
| [`images`](images.md) | List images |
|
|
||||||
| [`import`](import.md) | Import the contents from a tarball to create a filesystem image |
|
|
||||||
| [`info`](info.md) | Display system-wide information |
|
|
||||||
| [`inspect`](inspect.md) | Return low-level information on Docker objects |
|
|
||||||
| [`kill`](kill.md) | Kill one or more running containers |
|
|
||||||
| [`load`](load.md) | Load an image from a tar archive or STDIN |
|
|
||||||
| [`login`](login.md) | Log in to a registry |
|
|
||||||
| [`logout`](logout.md) | Log out from a registry |
|
|
||||||
| [`logs`](logs.md) | Fetch the logs of a container |
|
|
||||||
| [`manifest`](manifest.md) | Manage Docker image manifests and manifest lists |
|
|
||||||
| [`network`](network.md) | Manage networks |
|
|
||||||
| [`node`](node.md) | Manage Swarm nodes |
|
|
||||||
| [`pause`](pause.md) | Pause all processes within one or more containers |
|
|
||||||
| [`plugin`](plugin.md) | Manage plugins |
|
|
||||||
| [`port`](port.md) | List port mappings or a specific mapping for the container |
|
|
||||||
| [`ps`](ps.md) | List containers |
|
|
||||||
| [`pull`](pull.md) | Download an image from a registry |
|
|
||||||
| [`push`](push.md) | Upload an image to a registry |
|
|
||||||
| [`rename`](rename.md) | Rename a container |
|
|
||||||
| [`restart`](restart.md) | Restart one or more containers |
|
|
||||||
| [`rm`](rm.md) | Remove one or more containers |
|
|
||||||
| [`rmi`](rmi.md) | Remove one or more images |
|
|
||||||
| [`run`](run.md) | Create and run a new container from an image |
|
|
||||||
| [`save`](save.md) | Save one or more images to a tar archive (streamed to STDOUT by default) |
|
|
||||||
| [`search`](search.md) | Search Docker Hub for images |
|
|
||||||
| [`secret`](secret.md) | Manage Swarm secrets |
|
|
||||||
| [`service`](service.md) | Manage Swarm services |
|
|
||||||
| [`stack`](stack.md) | Manage Swarm stacks |
|
|
||||||
| [`start`](start.md) | Start one or more stopped containers |
|
|
||||||
| [`stats`](stats.md) | Display a live stream of container(s) resource usage statistics |
|
|
||||||
| [`stop`](stop.md) | Stop one or more running containers |
|
|
||||||
| [`swarm`](swarm.md) | Manage Swarm |
|
|
||||||
| [`system`](system.md) | Manage Docker |
|
|
||||||
| [`tag`](tag.md) | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE |
|
|
||||||
| [`top`](top.md) | Display the running processes of a container |
|
|
||||||
| [`trust`](trust.md) | Manage trust on Docker images |
|
|
||||||
| [`unpause`](unpause.md) | Unpause all processes within one or more containers |
|
|
||||||
| [`update`](update.md) | Update configuration of one or more containers |
|
|
||||||
| [`version`](version.md) | Show the Docker version information |
|
|
||||||
| [`volume`](volume.md) | Manage volumes |
|
|
||||||
| [`wait`](wait.md) | Block until one or more containers stop, then print their exit codes |
|
|
||||||
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
|
||||||
|:---------------------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `--config` | `string` | `/root/.docker` | Location of client config files |
|
|
||||||
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
|
|
||||||
| `-D`, `--debug` | | | Enable debug mode |
|
|
||||||
| [`-H`](#host), [`--host`](#host) | `list` | | Daemon socket to connect to |
|
|
||||||
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
|
|
||||||
| `--tls` | | | Use TLS; implied by --tlsverify |
|
|
||||||
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
|
|
||||||
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
|
|
||||||
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
|
|
||||||
| `--tlsverify` | | | Use TLS and verify the remote |
|
|
||||||
|
|
||||||
|
|
||||||
<!---MARKER_GEN_END-->
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
Depending on your Docker system configuration, you may be required to preface
|
Depending on your Docker system configuration, you may be required to preface
|
||||||
each `docker` command with `sudo`. To avoid having to use `sudo` with the
|
each `docker` command with `sudo`. To avoid having to use `sudo` with the
|
||||||
@@ -124,7 +27,7 @@ The following list of environment variables are supported by the `docker` comman
|
|||||||
line:
|
line:
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
|:------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| :---------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `DOCKER_API_VERSION` | Override the negotiated API version to use for debugging (e.g. `1.19`) |
|
| `DOCKER_API_VERSION` | Override the negotiated API version to use for debugging (e.g. `1.19`) |
|
||||||
| `DOCKER_CERT_PATH` | Location of your authentication keys. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
|
| `DOCKER_CERT_PATH` | Location of your authentication keys. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
|
||||||
| `DOCKER_CONFIG` | The location of your client configuration files. |
|
| `DOCKER_CONFIG` | The location of your client configuration files. |
|
||||||
@@ -136,7 +39,7 @@ line:
|
|||||||
| `DOCKER_HOST` | Daemon socket to connect to. |
|
| `DOCKER_HOST` | Daemon socket to connect to. |
|
||||||
| `DOCKER_TLS` | Enable TLS for connections made by the `docker` CLI (equivalent of the `--tls` command-line option). Set to a non-empty value to enable TLS. Note that TLS is enabled automatically if any of the other TLS options are set. |
|
| `DOCKER_TLS` | Enable TLS for connections made by the `docker` CLI (equivalent of the `--tls` command-line option). Set to a non-empty value to enable TLS. Note that TLS is enabled automatically if any of the other TLS options are set. |
|
||||||
| `DOCKER_TLS_VERIFY` | When set Docker uses TLS and verifies the remote. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
|
| `DOCKER_TLS_VERIFY` | When set Docker uses TLS and verifies the remote. This variable is used both by the `docker` CLI and the [`dockerd` daemon](dockerd.md) |
|
||||||
| `BUILDKIT_PROGRESS` | Set type of progress output (`auto`, `plain`, `tty`) when [building](build.md) with [BuildKit backend](https://docs.docker.com/build/buildkit/). Use plain to show container output (default `auto`). |
|
| `BUILDKIT_PROGRESS` | Set type of progress output (`auto`, `plain`, `tty`) when [building](image_build.md) with [BuildKit backend](https://docs.docker.com/build/buildkit/). Use plain to show container output (default `auto`). |
|
||||||
|
|
||||||
Because Docker is developed using Go, you can also use any environment
|
Because Docker is developed using Go, you can also use any environment
|
||||||
variables used by the Go runtime. In particular, you may find these useful:
|
variables used by the Go runtime. In particular, you may find these useful:
|
||||||
@@ -215,15 +118,15 @@ if no `--format` flag is provided.
|
|||||||
| Property | Description |
|
| Property | Description |
|
||||||
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `configFormat` | Custom default format for `docker config ls` output. See [`docker config ls`](config_ls.md#format) for a list of supported formatting directives. |
|
| `configFormat` | Custom default format for `docker config ls` output. See [`docker config ls`](config_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `imagesFormat` | Custom default format for `docker images` / `docker image ls` output. See [`docker images`](images.md#format) for a list of supported formatting directives. |
|
| `imagesFormat` | Custom default format for `docker images` / `docker image ls` output. See [`docker images`](image_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `networksFormat` | Custom default format for `docker network ls` output. See [`docker network ls`](network_ls.md#format) for a list of supported formatting directives. |
|
| `networksFormat` | Custom default format for `docker network ls` output. See [`docker network ls`](network_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `nodesFormat` | Custom default format for `docker node ls` output. See [`docker node ls`](node_ls.md#format) for a list of supported formatting directives. |
|
| `nodesFormat` | Custom default format for `docker node ls` output. See [`docker node ls`](node_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `pluginsFormat` | Custom default format for `docker plugin ls` output. See [`docker plugin ls`](plugin_ls.md#format) for a list of supported formatting directives. |
|
| `pluginsFormat` | Custom default format for `docker plugin ls` output. See [`docker plugin ls`](plugin_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `psFormat` | Custom default format for `docker ps` / `docker container ps` output. See [`docker ps`](ps.md#format) for a list of supported formatting directives. |
|
| `psFormat` | Custom default format for `docker ps` / `docker container ps` output. See [`docker ps`](container_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `secretFormat` | Custom default format for `docker secret ls` output. See [`docker secret ls`](secret_ls.md#format) for a list of supported formatting directives. |
|
| `secretFormat` | Custom default format for `docker secret ls` output. See [`docker secret ls`](secret_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `serviceInspectFormat` | Custom default format for `docker service inspect` output. See [`docker service inspect`](service_inspect.md#format) for a list of supported formatting directives. |
|
| `serviceInspectFormat` | Custom default format for `docker service inspect` output. See [`docker service inspect`](service_inspect.md#format) for a list of supported formatting directives. |
|
||||||
| `servicesFormat` | Custom default format for `docker service ls` output. See [`docker service ls`](service_ls.md#format) for a list of supported formatting directives. |
|
| `servicesFormat` | Custom default format for `docker service ls` output. See [`docker service ls`](service_ls.md#format) for a list of supported formatting directives. |
|
||||||
| `statsFormat` | Custom default format for `docker stats` output. See [`docker stats`](stats.md#format) for a list of supported formatting directives. |
|
| `statsFormat` | Custom default format for `docker stats` output. See [`docker stats`](container_stats.md#format) for a list of supported formatting directives. |
|
||||||
| `tasksFormat` | Custom default format for `docker stack ps` output. See [`docker stack ps`](stack_ps.md#format) for a list of supported formatting directives. |
|
| `tasksFormat` | Custom default format for `docker stack ps` output. See [`docker stack ps`](stack_ps.md#format) for a list of supported formatting directives. |
|
||||||
| `volumesFormat` | Custom default format for `docker volume ls` output. See [`docker volume ls`](volume_ls.md#format) for a list of supported formatting directives. |
|
| `volumesFormat` | Custom default format for `docker volume ls` output. See [`docker volume ls`](volume_ls.md#format) for a list of supported formatting directives. |
|
||||||
|
|
||||||
|
|||||||
@@ -858,6 +858,38 @@ PS C:\> docker run --device=class/86E0D1E0-8089-11D0-9CE4-08003E301F73 mcr.micro
|
|||||||
> The `--device` option is only supported on process-isolated Windows containers,
|
> The `--device` option is only supported on process-isolated Windows containers,
|
||||||
> and produces an error if the container isolation is `hyperv`.
|
> and produces an error if the container isolation is `hyperv`.
|
||||||
|
|
||||||
|
#### CDI devices
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> This is experimental feature and as such doesn't represent a stable API.
|
||||||
|
|
||||||
|
Container Device Interface (CDI) is a
|
||||||
|
[standardized](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
|
||||||
|
mechanism for container runtimes to create containers which are able to
|
||||||
|
interact with third party devices.
|
||||||
|
|
||||||
|
With CDI, device configurations are defined using a JSON file. In addition to
|
||||||
|
enabling the container to interact with the device node, it also lets you
|
||||||
|
specify additional configuration for the device, such as kernel modules, host
|
||||||
|
libraries, and environment variables.
|
||||||
|
|
||||||
|
You can reference a CDI device with the `--device` flag using the
|
||||||
|
fully-qualified name of the device, as shown in the following example:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker run --device=vendor.com/class=device-name --rm -it ubuntu
|
||||||
|
```
|
||||||
|
|
||||||
|
This starts an `ubuntu` container with access to the specified CDI device,
|
||||||
|
`vendor.com/class=device-name`, assuming that:
|
||||||
|
|
||||||
|
- A valid CDI specification (JSON file) for the requested device is available
|
||||||
|
on the system running the daemon, in one of the configured CDI specification
|
||||||
|
directories.
|
||||||
|
- The CDI feature has been enabled on the daemon side, see [Enable CDI
|
||||||
|
devices](dockerd.md#enable-cdi-devices).
|
||||||
|
|
||||||
### <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
|
||||||
@@ -900,7 +932,7 @@ $ cat somefile | docker run -i -a stdin mybuilder dobuild
|
|||||||
> Linux: it ignores any signal with the default action. So, the process
|
> Linux: it ignores any signal with the default action. So, the process
|
||||||
> doesn't terminate on `SIGINT` or `SIGTERM` unless it's coded to do so.
|
> doesn't terminate on `SIGINT` or `SIGTERM` unless it's coded to do so.
|
||||||
|
|
||||||
See also [the `docker cp` command](cp.md).
|
See also [the `docker cp` command](container_cp.md).
|
||||||
|
|
||||||
### <a name="interactive"></a> Keep STDIN open (-i, --interactive)
|
### <a name="interactive"></a> Keep STDIN open (-i, --interactive)
|
||||||
|
|
||||||
@@ -1016,6 +1048,11 @@ the required device when it is added.
|
|||||||
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 the [nvidia-container-runtime](https://nvidia.github.io/nvidia-container-runtime/).
|
install the [nvidia-container-runtime](https://nvidia.github.io/nvidia-container-runtime/).
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> You can also specify a GPU as a CDI device with the `--device` flag, see
|
||||||
|
> [CDI devices](#cdi-devices).
|
||||||
|
|
||||||
Read [Specify a container's resources](https://docs.docker.com/config/containers/resource_constraints/)
|
Read [Specify a container's resources](https://docs.docker.com/config/containers/resource_constraints/)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
@@ -1060,8 +1097,8 @@ This runs the `redis` container with a restart policy of **always**.
|
|||||||
If the container exits, Docker restarts it.
|
If the container exits, Docker restarts it.
|
||||||
|
|
||||||
When a restart policy is active on a container, it shows as either `Up` or
|
When a restart policy is active on a container, it shows as either `Up` or
|
||||||
`Restarting` in [`docker ps`](ps.md). It can also be useful to use [`docker
|
`Restarting` in [`docker ps`](container_ls.md). It can also be useful to use
|
||||||
events`](events.md) to see the restart policy in effect.
|
[`docker events`](system_events.md) to see the restart policy in effect.
|
||||||
|
|
||||||
An increasing delay (double the previous delay, starting at 100 milliseconds)
|
An increasing delay (double the previous delay, starting at 100 milliseconds)
|
||||||
is added before each restart to prevent flooding the server. This means the
|
is added before each restart to prevent flooding the server. This means the
|
||||||
@@ -1092,8 +1129,8 @@ restart limit is only valid for the **on-failure** policy.
|
|||||||
#### Inspect container restarts
|
#### Inspect container restarts
|
||||||
|
|
||||||
The number of (attempted) restarts for a container can be obtained using the
|
The number of (attempted) restarts for a container can be obtained using the
|
||||||
[`docker inspect`](commandline/inspect.md) command. For example, to get the
|
[`docker inspect`](inspect.md) command. For example, to get the number of
|
||||||
number of restarts for container "my-container";
|
restarts for container "my-container";
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker inspect -f "{{ .RestartCount }}" my-container
|
$ docker inspect -f "{{ .RestartCount }}" my-container
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
# docker
|
||||||
|
|
||||||
|
<!---MARKER_GEN_START-->
|
||||||
|
The base command for the Docker CLI.
|
||||||
|
|
||||||
|
### Subcommands
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|:------------------------------|:------------------------------------------------------------------------------|
|
||||||
|
| [`attach`](attach.md) | Attach local standard input, output, and error streams to a running container |
|
||||||
|
| [`build`](build.md) | Build an image from a Dockerfile |
|
||||||
|
| [`builder`](builder.md) | Manage builds |
|
||||||
|
| [`checkpoint`](checkpoint.md) | Manage checkpoints |
|
||||||
|
| [`commit`](commit.md) | Create a new image from a container's changes |
|
||||||
|
| [`config`](config.md) | Manage Swarm configs |
|
||||||
|
| [`container`](container.md) | Manage containers |
|
||||||
|
| [`context`](context.md) | Manage contexts |
|
||||||
|
| [`cp`](cp.md) | Copy files/folders between a container and the local filesystem |
|
||||||
|
| [`create`](create.md) | Create a new container |
|
||||||
|
| [`diff`](diff.md) | Inspect changes to files or directories on a container's filesystem |
|
||||||
|
| [`events`](events.md) | Get real time events from the server |
|
||||||
|
| [`exec`](exec.md) | Execute a command in a running container |
|
||||||
|
| [`export`](export.md) | Export a container's filesystem as a tar archive |
|
||||||
|
| [`history`](history.md) | Show the history of an image |
|
||||||
|
| [`image`](image.md) | Manage images |
|
||||||
|
| [`images`](images.md) | List images |
|
||||||
|
| [`import`](import.md) | Import the contents from a tarball to create a filesystem image |
|
||||||
|
| [`info`](info.md) | Display system-wide information |
|
||||||
|
| [`inspect`](inspect.md) | Return low-level information on Docker objects |
|
||||||
|
| [`kill`](kill.md) | Kill one or more running containers |
|
||||||
|
| [`load`](load.md) | Load an image from a tar archive or STDIN |
|
||||||
|
| [`login`](login.md) | Log in to a registry |
|
||||||
|
| [`logout`](logout.md) | Log out from a registry |
|
||||||
|
| [`logs`](logs.md) | Fetch the logs of a container |
|
||||||
|
| [`manifest`](manifest.md) | Manage Docker image manifests and manifest lists |
|
||||||
|
| [`network`](network.md) | Manage networks |
|
||||||
|
| [`node`](node.md) | Manage Swarm nodes |
|
||||||
|
| [`pause`](pause.md) | Pause all processes within one or more containers |
|
||||||
|
| [`plugin`](plugin.md) | Manage plugins |
|
||||||
|
| [`port`](port.md) | List port mappings or a specific mapping for the container |
|
||||||
|
| [`ps`](ps.md) | List containers |
|
||||||
|
| [`pull`](pull.md) | Download an image from a registry |
|
||||||
|
| [`push`](push.md) | Upload an image to a registry |
|
||||||
|
| [`rename`](rename.md) | Rename a container |
|
||||||
|
| [`restart`](restart.md) | Restart one or more containers |
|
||||||
|
| [`rm`](rm.md) | Remove one or more containers |
|
||||||
|
| [`rmi`](rmi.md) | Remove one or more images |
|
||||||
|
| [`run`](run.md) | Create and run a new container from an image |
|
||||||
|
| [`save`](save.md) | Save one or more images to a tar archive (streamed to STDOUT by default) |
|
||||||
|
| [`search`](search.md) | Search Docker Hub for images |
|
||||||
|
| [`secret`](secret.md) | Manage Swarm secrets |
|
||||||
|
| [`service`](service.md) | Manage Swarm services |
|
||||||
|
| [`stack`](stack.md) | Manage Swarm stacks |
|
||||||
|
| [`start`](start.md) | Start one or more stopped containers |
|
||||||
|
| [`stats`](stats.md) | Display a live stream of container(s) resource usage statistics |
|
||||||
|
| [`stop`](stop.md) | Stop one or more running containers |
|
||||||
|
| [`swarm`](swarm.md) | Manage Swarm |
|
||||||
|
| [`system`](system.md) | Manage Docker |
|
||||||
|
| [`tag`](tag.md) | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE |
|
||||||
|
| [`top`](top.md) | Display the running processes of a container |
|
||||||
|
| [`trust`](trust.md) | Manage trust on Docker images |
|
||||||
|
| [`unpause`](unpause.md) | Unpause all processes within one or more containers |
|
||||||
|
| [`update`](update.md) | Update configuration of one or more containers |
|
||||||
|
| [`version`](version.md) | Show the Docker version information |
|
||||||
|
| [`volume`](volume.md) | Manage volumes |
|
||||||
|
| [`wait`](wait.md) | Block until one or more containers stop, then print their exit codes |
|
||||||
|
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
| Name | Type | Default | Description |
|
||||||
|
|:--------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `--config` | `string` | `/root/.docker` | Location of client config files |
|
||||||
|
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
|
||||||
|
| `-D`, `--debug` | | | Enable debug mode |
|
||||||
|
| `-H`, `--host` | `list` | | Daemon socket to connect to |
|
||||||
|
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
|
||||||
|
| `--tls` | | | Use TLS; implied by --tlsverify |
|
||||||
|
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
|
||||||
|
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
|
||||||
|
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
|
||||||
|
| `--tlsverify` | | | Use TLS and verify the remote |
|
||||||
|
|
||||||
|
|
||||||
|
<!---MARKER_GEN_END-->
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ Options:
|
|||||||
--authorization-plugin list Authorization plugins to load
|
--authorization-plugin list Authorization plugins to load
|
||||||
--bip string Specify network bridge IP
|
--bip string Specify network bridge IP
|
||||||
-b, --bridge string Attach containers to a network bridge
|
-b, --bridge string Attach containers to a network bridge
|
||||||
|
--cdi-spec-dir list CDI specification directories to use
|
||||||
--cgroup-parent string Set parent cgroup for all containers
|
--cgroup-parent string Set parent cgroup for all containers
|
||||||
--config-file string Daemon configuration file (default "/etc/docker/daemon.json")
|
--config-file string Daemon configuration file (default "/etc/docker/daemon.json")
|
||||||
--containerd string containerd grpc address
|
--containerd string containerd grpc address
|
||||||
@@ -848,12 +849,52 @@ flag for the dockerd command line interface, or the `host-gateway-ip` key in
|
|||||||
the daemon configuration file.
|
the daemon configuration file.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ dockerd --host-gateway-ip 192.0.2.0
|
$ cat > /etc/docker/daemon.json
|
||||||
|
{ "host-gateway-ip": "192.0.2.0" }
|
||||||
|
$ sudo systemctl restart docker
|
||||||
$ docker run -it --add-host host.docker.internal:host-gateway \
|
$ docker run -it --add-host host.docker.internal:host-gateway \
|
||||||
busybox ping host.docker.internal
|
busybox ping host.docker.internal
|
||||||
PING host.docker.internal (192.0.2.0): 56 data bytes
|
PING host.docker.internal (192.0.2.0): 56 data bytes
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Enable CDI devices
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> This is experimental feature and as such doesn't represent a stable API.
|
||||||
|
>
|
||||||
|
> This feature isn't enabled by default. To this feature, set `features.cdi` to
|
||||||
|
> `true` in the `daemon.json` configuration file.
|
||||||
|
|
||||||
|
Container Device Interface (CDI) is a
|
||||||
|
[standardized](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
|
||||||
|
mechanism for container runtimes to create containers which are able to
|
||||||
|
interact with third party devices.
|
||||||
|
|
||||||
|
The Docker daemon supports running containers with CDI devices if the requested
|
||||||
|
device specifications are available on the filesystem of the daemon.
|
||||||
|
|
||||||
|
The default specification directors are:
|
||||||
|
|
||||||
|
- `/etc/cdi/` for static CDI Specs
|
||||||
|
- `/var/run/cdi` for generated CDI Specs
|
||||||
|
|
||||||
|
Alternatively, you can set custom locations for CDI specifications using the
|
||||||
|
`cdi-spec-dirs` option in the `daemon.json` configuration file, or the
|
||||||
|
`--cdi-spec-dir` flag for the `dockerd` CLI.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"features": {
|
||||||
|
"cdi": true
|
||||||
|
},
|
||||||
|
"cdi-spec-dirs": ["/etc/cdi/", "/var/run/cdi"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When CDI is enabled for a daemon, you can view the configured CDI specification
|
||||||
|
directories using the `docker info` command.
|
||||||
|
|
||||||
### Miscellaneous options
|
### Miscellaneous options
|
||||||
|
|
||||||
IP masquerading uses address translation to allow containers without a public
|
IP masquerading uses address translation to allow containers without a public
|
||||||
@@ -1033,6 +1074,7 @@ The following is a full example of the allowed configuration options on Linux:
|
|||||||
"fixed-cidr": "",
|
"fixed-cidr": "",
|
||||||
"fixed-cidr-v6": "",
|
"fixed-cidr-v6": "",
|
||||||
"group": "",
|
"group": "",
|
||||||
|
"host-gateway-ip": "",
|
||||||
"hosts": [],
|
"hosts": [],
|
||||||
"proxies": {
|
"proxies": {
|
||||||
"http-proxy": "http://proxy.example.com:80",
|
"http-proxy": "http://proxy.example.com:80",
|
||||||
@@ -1142,6 +1184,7 @@ The following is a full example of the allowed configuration options on Windows:
|
|||||||
"features": {},
|
"features": {},
|
||||||
"fixed-cidr": "",
|
"fixed-cidr": "",
|
||||||
"group": "",
|
"group": "",
|
||||||
|
"host-gateway-ip": "",
|
||||||
"hosts": [],
|
"hosts": [],
|
||||||
"insecure-registries": [],
|
"insecure-registries": [],
|
||||||
"labels": [],
|
"labels": [],
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ $ docker build -t vieux/apache:2.0 .
|
|||||||
This examples builds in the same way as the previous example, but it then tags the resulting
|
This examples builds in the same way as the previous example, but it then tags the resulting
|
||||||
image. The repository name will be `vieux/apache` and the tag `2.0`.
|
image. The repository name will be `vieux/apache` and the tag `2.0`.
|
||||||
|
|
||||||
[Read more about valid tags](tag.md).
|
[Read more about valid tags](image_tag.md).
|
||||||
|
|
||||||
You can apply multiple tags to an image. For example, you can apply the `latest`
|
You can apply multiple tags to an image. For example, you can apply the `latest`
|
||||||
tag to a newly built image and add another tag that references a specific
|
tag to a newly built image and add another tag that references a specific
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Status: Downloaded newer image for debian:bookworm
|
|||||||
docker.io/library/debian:bookworm
|
docker.io/library/debian:bookworm
|
||||||
```
|
```
|
||||||
|
|
||||||
To see which images are present locally, use the [`docker images`](images.md)
|
To see which images are present locally, use the [`docker images`](image_ls.md)
|
||||||
command:
|
command:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ Upload an image to a registry
|
|||||||
Use `docker image push` to share your images to the [Docker Hub](https://hub.docker.com)
|
Use `docker image push` to share your images to the [Docker Hub](https://hub.docker.com)
|
||||||
registry or to a self-hosted one.
|
registry or to a self-hosted one.
|
||||||
|
|
||||||
Refer to the [`docker image tag`](tag.md) reference for more information about valid
|
Refer to the [`docker image tag`](image_tag.md) reference for more information
|
||||||
image and tag names.
|
about valid image and tag names.
|
||||||
|
|
||||||
Killing the `docker image push` process, for example by pressing `CTRL-c` while it is
|
Killing the `docker image push` process, for example by pressing `CTRL-c` while it is
|
||||||
running in a terminal, terminates the push operation.
|
running in a terminal, terminates the push operation.
|
||||||
@@ -46,9 +46,9 @@ this via the `--max-concurrent-uploads` daemon option. See the
|
|||||||
|
|
||||||
### Push a new image to a registry
|
### Push a new image to a registry
|
||||||
|
|
||||||
First save the new image by finding the container ID (using [`docker container ls`](ps.md))
|
First save the new image by finding the container ID (using [`docker container
|
||||||
and then committing it to a new image name. Note that only `a-z0-9-_.` are
|
ls`](container_ls.md)) and then committing it to a new image name. Note that
|
||||||
allowed when naming images:
|
only `a-z0-9-_.` are allowed when naming images:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker container commit c16378f943fe rhel-httpd:latest
|
$ docker container commit c16378f943fe rhel-httpd:latest
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ removed.
|
|||||||
|
|
||||||
This does not remove images from a registry. You cannot remove an image of a
|
This does not remove images from a registry. You cannot remove an image of a
|
||||||
running container unless you use the `-f` option. To see all images on a host
|
running container unless you use the `-f` option. To see all images on a host
|
||||||
use the [`docker image ls`](images.md) command.
|
use the [`docker image ls`](image_ls.md) command.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|||||||
@@ -47,17 +47,17 @@ information about the `overlay2` storage driver is shown:
|
|||||||
```console
|
```console
|
||||||
$ docker info
|
$ docker info
|
||||||
|
|
||||||
Client: Docker Engine - Community
|
Client:
|
||||||
Version: 24.0.0
|
Version: 25.0.0
|
||||||
Context: default
|
Context: default
|
||||||
Debug Mode: false
|
Debug Mode: false
|
||||||
Plugins:
|
Plugins:
|
||||||
buildx: Docker Buildx (Docker Inc.)
|
buildx: Docker Buildx (Docker Inc.)
|
||||||
Version: v0.10.4
|
Version: v0.12.1
|
||||||
Path: /usr/libexec/docker/cli-plugins/docker-buildx
|
Path: /usr/local/libexec/docker/cli-plugins/docker-buildx
|
||||||
compose: Docker Compose (Docker Inc.)
|
compose: Docker Compose (Docker Inc.)
|
||||||
Version: v2.17.2
|
Version: v2.24.1
|
||||||
Path: /usr/libexec/docker/cli-plugins/docker-compose
|
Path: /usr/local/libexec/docker/cli-plugins/docker-compose
|
||||||
|
|
||||||
Server:
|
Server:
|
||||||
Containers: 14
|
Containers: 14
|
||||||
@@ -65,15 +65,11 @@ Server:
|
|||||||
Paused: 1
|
Paused: 1
|
||||||
Stopped: 10
|
Stopped: 10
|
||||||
Images: 52
|
Images: 52
|
||||||
Server Version: 23.0.3
|
Server Version: 25.0.0
|
||||||
Storage Driver: overlay2
|
Storage Driver: overlayfs
|
||||||
Backing Filesystem: extfs
|
driver-type: io.containerd.snapshotter.v1
|
||||||
Supports d_type: true
|
|
||||||
Using metacopy: false
|
|
||||||
Native Overlay Diff: true
|
|
||||||
userxattr: false
|
|
||||||
Logging Driver: json-file
|
Logging Driver: json-file
|
||||||
Cgroup Driver: systemd
|
Cgroup Driver: cgroupfs
|
||||||
Cgroup Version: 2
|
Cgroup Version: 2
|
||||||
Plugins:
|
Plugins:
|
||||||
Volume: local
|
Volume: local
|
||||||
@@ -83,33 +79,31 @@ Server:
|
|||||||
/etc/cdi
|
/etc/cdi
|
||||||
/var/run/cdi
|
/var/run/cdi
|
||||||
Swarm: inactive
|
Swarm: inactive
|
||||||
Runtimes: io.containerd.runc.v2 runc
|
Runtimes: runc io.containerd.runc.v2
|
||||||
Default Runtime: runc
|
Default Runtime: runc
|
||||||
Init Binary: docker-init
|
Init Binary: docker-init
|
||||||
containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
|
containerd version: 71909c1814c544ac47ab91d2e8b84718e517bb99
|
||||||
runc version: v1.1.5-0-gf19387a
|
runc version: v1.1.11-0-g4bccb38
|
||||||
init version: de40ad0
|
init version: de40ad0
|
||||||
Security Options:
|
Security Options:
|
||||||
apparmor
|
|
||||||
seccomp
|
seccomp
|
||||||
Profile: builtin
|
Profile: builtin
|
||||||
cgroupns
|
cgroupns
|
||||||
Kernel Version: 5.15.0-25-generic
|
Kernel Version: 6.5.11-linuxkit
|
||||||
Operating System: Ubuntu 22.04 LTS
|
Operating System: Alpine Linux v3.19
|
||||||
OSType: linux
|
OSType: linux
|
||||||
Architecture: x86_64
|
Architecture: aarch64
|
||||||
CPUs: 1
|
CPUs: 10
|
||||||
Total Memory: 991.7 MiB
|
Total Memory: 7.663GiB
|
||||||
Name: ip-172-30-0-91.ec2.internal
|
Name: 4a7ed206a70d
|
||||||
ID: 4cee4408-10d2-4e17-891c-a41736ac4536
|
ID: c20f7230-59a2-4824-a2f4-fda71c982ee6
|
||||||
Docker Root Dir: /var/lib/docker
|
Docker Root Dir: /var/lib/docker
|
||||||
Debug Mode: false
|
Debug Mode: false
|
||||||
Username: gordontheturtle
|
|
||||||
Experimental: false
|
Experimental: false
|
||||||
Insecure Registries:
|
Insecure Registries:
|
||||||
myinsecurehost:5000
|
|
||||||
127.0.0.0/8
|
127.0.0.0/8
|
||||||
Live Restore Enabled: false
|
Live Restore Enabled: false
|
||||||
|
Product License: Community Engine
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name="format"></a> Format the output (--format)
|
### <a name="format"></a> Format the output (--format)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ export GO111MODULE=auto
|
|||||||
|
|
||||||
function clean {
|
function clean {
|
||||||
rm -rf "$buildir"
|
rm -rf "$buildir"
|
||||||
if [ -f "$(pwd)/docs/reference/commandline/docker.md" ]; then
|
|
||||||
mv "$(pwd)/docs/reference/commandline/docker.md" "$(pwd)/docs/reference/commandline/cli.md"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildir=$(mktemp -d -t docker-cli-docsgen.XXXXXXXXXX)
|
buildir=$(mktemp -d -t docker-cli-docsgen.XXXXXXXXXX)
|
||||||
@@ -32,12 +29,6 @@ trap clean EXIT
|
|||||||
go build -mod=vendor -modfile=vendor.mod -tags docsgen -o /tmp/docsgen ./docs/generate/generate.go
|
go build -mod=vendor -modfile=vendor.mod -tags docsgen -o /tmp/docsgen ./docs/generate/generate.go
|
||||||
)
|
)
|
||||||
|
|
||||||
# yaml generation on docs repo needs the cli.md file: https://github.com/docker/cli/pull/3924#discussion_r1059986605
|
|
||||||
# but markdown generation docker.md atm. While waiting for a fix in cli-docs-tool
|
|
||||||
# we need to first move the cli.md file to docker.md, do the generation and
|
|
||||||
# then move it back in trap handler.
|
|
||||||
mv "$(pwd)/docs/reference/commandline/cli.md" "$(pwd)/docs/reference/commandline/docker.md"
|
|
||||||
|
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
/tmp/docsgen --formats md --source "$(pwd)/docs/reference/commandline" --target "$(pwd)/docs/reference/commandline"
|
/tmp/docsgen --formats md --source "$(pwd)/docs/reference/commandline" --target "$(pwd)/docs/reference/commandline"
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ require (
|
|||||||
github.com/creack/pty v1.1.21
|
github.com/creack/pty v1.1.21
|
||||||
github.com/distribution/reference v0.5.0
|
github.com/distribution/reference v0.5.0
|
||||||
github.com/docker/distribution v2.8.3+incompatible
|
github.com/docker/distribution v2.8.3+incompatible
|
||||||
github.com/docker/docker v25.0.0-rc.3+incompatible
|
github.com/docker/docker v25.0.0+incompatible
|
||||||
github.com/docker/docker-credential-helpers v0.8.1
|
github.com/docker/docker-credential-helpers v0.8.1
|
||||||
github.com/docker/go-connections v0.5.0
|
github.com/docker/go-connections v0.5.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
|
|||||||
+2
-2
@@ -54,8 +54,8 @@ github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5
|
|||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
||||||
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v25.0.0-rc.3+incompatible h1:f2YaukI/rOEueLwmDGAVcES5E8Y+BT/e7pQWLu/WZSk=
|
github.com/docker/docker v25.0.0+incompatible h1:g9b6wZTblhMgzOT2tspESstfw6ySZ9kdm94BLDKaZac=
|
||||||
github.com/docker/docker v25.0.0-rc.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v25.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
|
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
|
||||||
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||||
|
|||||||
Vendored
+1
-1
@@ -53,7 +53,7 @@ github.com/docker/distribution/registry/client/transport
|
|||||||
github.com/docker/distribution/registry/storage/cache
|
github.com/docker/distribution/registry/storage/cache
|
||||||
github.com/docker/distribution/registry/storage/cache/memory
|
github.com/docker/distribution/registry/storage/cache/memory
|
||||||
github.com/docker/distribution/uuid
|
github.com/docker/distribution/uuid
|
||||||
# github.com/docker/docker v25.0.0-rc.3+incompatible
|
# github.com/docker/docker v25.0.0+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/docker/api
|
github.com/docker/docker/api
|
||||||
github.com/docker/docker/api/types
|
github.com/docker/docker/api/types
|
||||||
|
|||||||
Reference in New Issue
Block a user