mirror of https://github.com/docker/cli.git
Merge pull request #1744 from thaJeztah/18.09_backport_docs_fixes
[18.09 backport] various docs fixes
This commit is contained in:
commit
ed16a3136b
|
@ -44,8 +44,8 @@ from different sessions on the Docker host.
|
|||
|
||||
To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the
|
||||
container. If `--sig-proxy` is true (the default),`CTRL-c` sends a `SIGINT` to
|
||||
the container. You can detach from a container and leave it running using the
|
||||
`CTRL-p CTRL-q` key sequence.
|
||||
the container. If the container was run with `-i` and `-t`, you can detach from
|
||||
a container and leave it running using the `CTRL-p CTRL-q` key sequence.
|
||||
|
||||
> **Note:**
|
||||
> A process running as PID 1 inside a container is treated specially by
|
||||
|
|
|
@ -504,13 +504,13 @@ stable.
|
|||
|
||||
|
||||
Squashing layers can be beneficial if your Dockerfile produces multiple layers
|
||||
modifying the same files, for example, file that are created in one step, and
|
||||
modifying the same files, for example, files that are created in one step, and
|
||||
removed in another step. For other use-cases, squashing images may actually have
|
||||
a negative impact on performance; when pulling an image consisting of multiple
|
||||
layers, layers can be pulled in parallel, and allows sharing layers between
|
||||
images (saving space).
|
||||
|
||||
For most use cases, multi-stage are a better alternative, as they give more
|
||||
For most use cases, multi-stage builds are a better alternative, as they give more
|
||||
fine-grained control over your build, and can take advantage of future
|
||||
optimizations in the builder. Refer to the [use multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/)
|
||||
section in the userguide for more information.
|
||||
|
@ -531,7 +531,7 @@ The `--squash` option has a number of known limitations:
|
|||
downloading a single layer cannot be parallelized.
|
||||
- When attempting to squash an image that does not make changes to the
|
||||
filesystem (for example, the Dockerfile only contains `ENV` instructions),
|
||||
the squash step will fail (see [issue #33823](https://github.com/moby/moby/issues/33823)
|
||||
the squash step will fail (see [issue #33823](https://github.com/moby/moby/issues/33823)).
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ the same file can share a single page cache entry (or entries), it makes
|
|||
> **Note**: As promising as `overlay` is, the feature is still quite young and
|
||||
> should not be used in production. Most notably, using `overlay` can cause
|
||||
> excessive inode consumption (especially as the number of images grows), as
|
||||
> well as > being incompatible with the use of RPMs.
|
||||
> well as being incompatible with the use of RPMs.
|
||||
|
||||
The `overlay2` uses the same fast union filesystem but takes advantage of
|
||||
[additional features](https://lkml.org/lkml/2015/2/11/106) added in Linux
|
||||
|
@ -1231,10 +1231,14 @@ The `--metrics-addr` option takes a tcp address to serve the metrics API.
|
|||
This feature is still experimental, therefore, the daemon must be running in experimental
|
||||
mode for this feature to work.
|
||||
|
||||
To serve the metrics API on localhost:1337 you would specify `--metrics-addr 127.0.0.1:1337`
|
||||
allowing you to make requests on the API at `127.0.0.1:1337/metrics` to receive metrics in the
|
||||
To serve the metrics API on `localhost:9323` you would specify `--metrics-addr 127.0.0.1:9323`,
|
||||
allowing you to make requests on the API at `127.0.0.1:9323/metrics` to receive metrics in the
|
||||
[prometheus](https://prometheus.io/docs/instrumenting/exposition_formats/) format.
|
||||
|
||||
Port `9323` is the [default port associated with Docker
|
||||
metrics](https://github.com/prometheus/prometheus/wiki/Default-port-allocations)
|
||||
to avoid collisions with other prometheus exporters and services.
|
||||
|
||||
If you are running a prometheus server you can add this address to your scrape configs
|
||||
to have prometheus collect metrics on Docker. For more information
|
||||
on prometheus you can view the website [here](https://prometheus.io/).
|
||||
|
@ -1243,7 +1247,7 @@ on prometheus you can view the website [here](https://prometheus.io/).
|
|||
scrape_configs:
|
||||
- job_name: 'docker'
|
||||
static_configs:
|
||||
- targets: ['127.0.0.1:1337']
|
||||
- targets: ['127.0.0.1:9323']
|
||||
```
|
||||
|
||||
Please note that this feature is still marked as experimental as metrics and metric
|
||||
|
@ -1308,7 +1312,7 @@ This is a full example of the allowed configuration options on Linux:
|
|||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "10m",
|
||||
"max-files":"5",
|
||||
"max-file":"5",
|
||||
"labels": "somelabel",
|
||||
"env": "os,customer"
|
||||
},
|
||||
|
|
|
@ -177,7 +177,7 @@ This is similar to tagging an image and pushing it to a foreign registry.
|
|||
|
||||
After you have created your local copy of the manifest list, you may optionally
|
||||
`annotate` it. Annotations allowed are the architecture and operating system (overriding the image's current values),
|
||||
os features, and an archictecure variant.
|
||||
os features, and an architecture variant.
|
||||
|
||||
Finally, you need to `push` your manifest list to the desired registry. Below are descriptions of these three commands,
|
||||
and an example putting them all together.
|
||||
|
@ -270,5 +270,5 @@ $ docker manifest create --insecure myprivateregistry.mycompany.com/repo/image:1
|
|||
$ docker manifest push --insecure myprivateregistry.mycompany.com/repo/image:tag
|
||||
```
|
||||
|
||||
Note that the `--insecure` flag is not required to annotate a manifest list, since annotations are to a locally-stored copy of a manifest list. You may also skip the `--insecure` flag if you are performaing a `docker manifest inspect` on a locally-stored manifest list. Be sure to keep in mind that locally-stored manifest lists are never used by the engine on a `docker pull`.
|
||||
Note that the `--insecure` flag is not required to annotate a manifest list, since annotations are to a locally-stored copy of a manifest list. You may also skip the `--insecure` flag if you are performing a `docker manifest inspect` on a locally-stored manifest list. Be sure to keep in mind that locally-stored manifest lists are never used by the engine on a `docker pull`.
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ Valid placeholders for the Go template are listed below:
|
|||
|
||||
Placeholder | Description
|
||||
----------------|------------------------------------------------------------------------------------------
|
||||
`.ID` | Task ID
|
||||
`.Name` | Task name
|
||||
`.Image` | Task image
|
||||
`.Node` | Node ID
|
||||
|
|
|
@ -26,6 +26,17 @@ Options:
|
|||
--no-prune Do not delete untagged parents
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
Removes (and un-tags) one or more images from the host node. If an image has
|
||||
multiple tags, using this command with the tag as a parameter only removes the
|
||||
tag. If the tag is the only one for the image, both the image and the tag are
|
||||
removed.
|
||||
|
||||
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
|
||||
use the [`docker image ls`](images.md) command.
|
||||
|
||||
## Examples
|
||||
|
||||
You can remove an image using its short or long ID, its tag, or its digest. If
|
||||
|
|
|
@ -717,15 +717,15 @@ $ docker run -d --isolation default busybox top
|
|||
On Windows, `--isolation` can take one of these values:
|
||||
|
||||
|
||||
| Value | Description |
|
||||
|:----------|:-------------------------------------------------------------------------------------------|
|
||||
| `default` | Use the value specified by the Docker daemon's `--exec-opt` or system default (see below). |
|
||||
| `process` | Shared-kernel namespace isolation (not supported on Windows client operating systems). |
|
||||
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
|
||||
| Value | Description |
|
||||
|:----------|:------------------------------------------------------------------------------------------------------------------|
|
||||
| `default` | Use the value specified by the Docker daemon's `--exec-opt` or system default (see below). |
|
||||
| `process` | Shared-kernel namespace isolation (not supported on Windows client operating systems older than Windows 10 1809). |
|
||||
| `hyperv` | Hyper-V hypervisor partition-based isolation. |
|
||||
|
||||
The default isolation on Windows server operating systems is `process`. The default (and only supported)
|
||||
The default isolation on Windows server operating systems is `process`. The default
|
||||
isolation on Windows client operating systems is `hyperv`. An attempt to start a container on a client
|
||||
operating system with `--isolation process` will fail.
|
||||
operating system older than Windows 10 1809 with `--isolation process` will fail.
|
||||
|
||||
On Windows server, assuming the default configuration, these commands are equivalent
|
||||
and result in `process` isolation:
|
||||
|
|
|
@ -219,7 +219,7 @@ tutorial](https://docs.docker.com/engine/swarm/swarm-tutorial/rolling-update/).
|
|||
|
||||
### Set environment variables (-e, --env)
|
||||
|
||||
This sets an environmental variable for all tasks in a service. For example:
|
||||
This sets an environment variable for all tasks in a service. For example:
|
||||
|
||||
```bash
|
||||
$ docker service create \
|
||||
|
|
|
@ -171,5 +171,5 @@ On Windows:
|
|||
"table {{.ID}}\t{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
|
||||
|
||||
|
||||
> **Note**: On Docker 17.09 and older, the `{{.Container}}` column was used, in
|
||||
> stead of `{{.ID}}\t{{.Name}}`.
|
||||
> **Note**: On Docker 17.09 and older, the `{{.Container}}` column was used,
|
||||
> instead of `{{.ID}}\t{{.Name}}`.
|
||||
|
|
|
@ -23,3 +23,29 @@ the same capabilities as the container, which may be limited. Set
|
|||
--user [user | user:group | uid | uid:gid | user:gid | uid:group ]
|
||||
|
||||
Without this argument the command will be run as root in the container.
|
||||
|
||||
# Exit Status
|
||||
|
||||
The exit code from `docker exec` gives information about why the container
|
||||
failed to exec or why it exited. When `docker exec` exits with a non-zero code,
|
||||
the exit codes follow the `chroot` standard, see below:
|
||||
|
||||
**_126_** if the **_contained command_** cannot be invoked
|
||||
|
||||
$ docker exec busybox /etc; echo $?
|
||||
# exec: "/etc": permission denied
|
||||
docker: Error response from daemon: Contained command could not be invoked
|
||||
126
|
||||
|
||||
**_127_** if the **_contained command_** cannot be found
|
||||
|
||||
$ docker exec busybox foo; echo $?
|
||||
# exec: "foo": executable file not found in $PATH
|
||||
docker: Error response from daemon: Contained command not found or does not exist
|
||||
127
|
||||
|
||||
**_Exit code_** of **_contained command_** otherwise
|
||||
|
||||
$ docker exec busybox /bin/sh -c 'exit 3'
|
||||
# 3
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
Removes one or more images from the host node. 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 use the **docker image ls** command.
|
||||
Removes (and un-tags) one or more images from the host node. If an image has
|
||||
multiple tags, using this command with the tag as a parameter only removes the
|
||||
tag. If the tag is the only one for the image, both the image and the tag are
|
||||
removed.
|
||||
|
||||
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
|
||||
use the **docker image ls** command.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
|
|
Loading…
Reference in New Issue