From 733325e26fa2d9a8cad358cd386e87373cf29dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Jare=C5=A1?= Date: Fri, 12 Oct 2018 10:07:33 +0200 Subject: [PATCH 01/14] Improve `docker image rm` documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `docker image rm` command can be used not only to remove images but also remove tags. This update improves the documentation to make this clear. Signed-off-by: Filip Jareš (cherry picked from commit 2ba9601ef13204119bf37a1174673eee4305a702) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 0717f261ed9c153d3b398e0ed8bb856dc7c51ce5 Component: cli --- components/cli/man/src/image/rm.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/cli/man/src/image/rm.md b/components/cli/man/src/image/rm.md index 348d45402e..e06a9387ac 100644 --- a/components/cli/man/src/image/rm.md +++ b/components/cli/man/src/image/rm.md @@ -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 From 380386942985074d98529643a22b864d99455fc0 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Thu, 29 Nov 2018 01:33:47 +0200 Subject: [PATCH 02/14] Replace environmental with environment Signed-off-by: Nir Soffer (cherry picked from commit f1f3d3be177234c936f8ddbbc266b66b0dbfe9e4) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 4c94a0af756049dcb9ab217b6e7df8c9ffe66742 Component: cli --- components/cli/docs/reference/commandline/service_create.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cli/docs/reference/commandline/service_create.md b/components/cli/docs/reference/commandline/service_create.md index 8fdb5297a1..bc68128d0c 100644 --- a/components/cli/docs/reference/commandline/service_create.md +++ b/components/cli/docs/reference/commandline/service_create.md @@ -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 \ From e0cf2f4f92775cbc151782c6cd97cb8cf7bce48a Mon Sep 17 00:00:00 2001 From: Anne Henmi Date: Wed, 12 Dec 2018 08:41:11 -0700 Subject: [PATCH 03/14] Fixed typo. Signed-off-by: Anne Henmi (cherry picked from commit 4aecd8bda1325f04509ede761a5cba8dcbca0db0) Signed-off-by: Sebastiaan van Stijn Upstream-commit: ce12ac2d146a583b4a34cddcebbb8e329b340ea6 Component: cli --- components/cli/docs/reference/commandline/dockerd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cli/docs/reference/commandline/dockerd.md b/components/cli/docs/reference/commandline/dockerd.md index cb3a87eee0..2a53a2ec88 100644 --- a/components/cli/docs/reference/commandline/dockerd.md +++ b/components/cli/docs/reference/commandline/dockerd.md @@ -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 From c81fbf531fe0511239aaeae80d72178811d5e1df Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Fri, 21 Dec 2018 09:04:21 +0100 Subject: [PATCH 04/14] docs(metrics-addr): Use port 9323, allocated for Docker in prometheus Signed-off-by: Frederic Hemberger (cherry picked from commit 89aa2cf9f68e5fd81c726e10e1e17dc9a308adb7) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 789a15bc73f80953c4811b8660361b21650c552b Component: cli --- components/cli/docs/reference/commandline/dockerd.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/cli/docs/reference/commandline/dockerd.md b/components/cli/docs/reference/commandline/dockerd.md index 2a53a2ec88..6ab5d7f285 100644 --- a/components/cli/docs/reference/commandline/dockerd.md +++ b/components/cli/docs/reference/commandline/dockerd.md @@ -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 From 0e8ded3923b082de568448b934535034c8a0a44c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 3 Jan 2019 19:37:19 +0100 Subject: [PATCH 05/14] docs: add missing ID placeholder for docker node ps Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 24018b9ffdb179ea002dc6a74c4d6f6444d424f9) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 08714b457909c8373eee8ebee10df7b4b4bb8b58 Component: cli --- components/cli/docs/reference/commandline/node_ps.md | 1 + 1 file changed, 1 insertion(+) diff --git a/components/cli/docs/reference/commandline/node_ps.md b/components/cli/docs/reference/commandline/node_ps.md index 30d37f0823..81e3ca18d7 100644 --- a/components/cli/docs/reference/commandline/node_ps.md +++ b/components/cli/docs/reference/commandline/node_ps.md @@ -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 From 8fe68b3c258929e6ee78908412a6023e460bbe50 Mon Sep 17 00:00:00 2001 From: zhoulin xie Date: Sun, 20 Jan 2019 01:20:34 +0800 Subject: [PATCH 06/14] Fix some typos in manifest.md Signed-off-by: zhoulin xie (cherry picked from commit abe1bb9757932bed0c10cd74014cac6f67dab6d0) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 537309a5486197bca5223cb72e5120bac7839841 Component: cli --- components/cli/docs/reference/commandline/manifest.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/docs/reference/commandline/manifest.md b/components/cli/docs/reference/commandline/manifest.md index ce31a30d69..13beb9cdde 100644 --- a/components/cli/docs/reference/commandline/manifest.md +++ b/components/cli/docs/reference/commandline/manifest.md @@ -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`. From 2b74693bae3e6310076a184e7bed1ef46ab42013 Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Mon, 21 Jan 2019 08:27:07 +0100 Subject: [PATCH 07/14] Update process isolation description for older Windows 10 versions Signed-off-by: Stefan Scherer (cherry picked from commit 7229920e2e9c0028aee56e18803245cc1d6dc021) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 4f6ab11ff439422fa2a81c98e64430448148cb47 Component: cli --- components/cli/docs/reference/commandline/run.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/cli/docs/reference/commandline/run.md b/components/cli/docs/reference/commandline/run.md index 08b9f18d68..754bc6d700 100644 --- a/components/cli/docs/reference/commandline/run.md +++ b/components/cli/docs/reference/commandline/run.md @@ -720,12 +720,12 @@ 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). | +| `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: From ab07868a3fe8ba61e4b133e635fa00bcc298abfd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 21 Jan 2019 16:15:45 +0100 Subject: [PATCH 08/14] Improve `docker image rm` reference docs Copies the improved description from the man page to the online reference docs. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 89bc5fbbae3b0fc309e894707970fcf237a38d1d) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 275ab1f0631a90e3098984a4eaef5f1fe65d7e18 Component: cli --- components/cli/docs/reference/commandline/rmi.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/cli/docs/reference/commandline/rmi.md b/components/cli/docs/reference/commandline/rmi.md index 66f194aba7..cc4f2f4111 100644 --- a/components/cli/docs/reference/commandline/rmi.md +++ b/components/cli/docs/reference/commandline/rmi.md @@ -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 From 0ddc0b1b54a49f5443423b0bb6731db407b2b56a Mon Sep 17 00:00:00 2001 From: Ryan Wilson-Perkin Date: Tue, 29 Jan 2019 17:04:46 -0500 Subject: [PATCH 09/14] Fix small typo Noticed a typo in this markdown file: "instead" instead of "in stead" Signed-off-by: Ryan Wilson-Perkin (cherry picked from commit 7a9fc782c52be1e03a0e5d3bb05ec55325d14caa) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 1d314f2227e5d387c93ea35541742c616cff5fd9 Component: cli --- components/cli/docs/reference/commandline/stats.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/docs/reference/commandline/stats.md b/components/cli/docs/reference/commandline/stats.md index 702e99a92c..44334254c3 100644 --- a/components/cli/docs/reference/commandline/stats.md +++ b/components/cli/docs/reference/commandline/stats.md @@ -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}}`. From d6ea168f883f07cfc0c4f0f8f79df61abbcfc233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4ufl?= Date: Thu, 7 Feb 2019 13:23:13 +0100 Subject: [PATCH 10/14] Fix typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Käufl (cherry picked from commit 0e469c1d1d85a134ce2c3233231cad2379af83c4) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 543f9b32eeb029080d6e93a13ec78058244a1a60 Component: cli --- components/cli/docs/reference/commandline/build.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/cli/docs/reference/commandline/build.md b/components/cli/docs/reference/commandline/build.md index a2f4763f84..21220c631d 100644 --- a/components/cli/docs/reference/commandline/build.md +++ b/components/cli/docs/reference/commandline/build.md @@ -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 From 3adaef1e746d5e5443adcc32805d0556ddd4edff Mon Sep 17 00:00:00 2001 From: Ben Creasy Date: Fri, 8 Feb 2019 12:45:40 -0800 Subject: [PATCH 11/14] Note caveat with detaching using key sequence This has come up a few times, e.g. https://github.com/moby/moby/issues/20864 and https://github.com/moby/moby/issues/35491 Signed-off-by: Ben Creasy (cherry picked from commit 767b25fc52a463b4e84be59dd4dbd7e4bc8ac385) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 8dc400713fb5cda0ccfe4f002d54048ad3dd3254 Component: cli --- components/cli/docs/reference/commandline/attach.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/docs/reference/commandline/attach.md b/components/cli/docs/reference/commandline/attach.md index 58286ad8aa..caba2f9770 100644 --- a/components/cli/docs/reference/commandline/attach.md +++ b/components/cli/docs/reference/commandline/attach.md @@ -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 From 8cae313dd6c75ad50093ee8041baddeab1203b89 Mon Sep 17 00:00:00 2001 From: stevejr <> Date: Wed, 13 Feb 2019 11:38:48 +0000 Subject: [PATCH 12/14] Corrected max-file option - was incorrectly spelt as max-files Signed-off-by: Steve Richards (cherry picked from commit 04f88005c924ab416c1641ced14d39f9efe4845e) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 74bd5f143ff0845dde78f78287696397f0325bf7 Component: cli --- components/cli/docs/reference/commandline/dockerd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cli/docs/reference/commandline/dockerd.md b/components/cli/docs/reference/commandline/dockerd.md index 6ab5d7f285..f177f15d94 100644 --- a/components/cli/docs/reference/commandline/dockerd.md +++ b/components/cli/docs/reference/commandline/dockerd.md @@ -1312,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" }, From 5def8bca289ce2046a2e5df2c79cc42aab9263d6 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Fri, 15 Feb 2019 11:51:46 +0000 Subject: [PATCH 13/14] Add exit status to docker exec manpage There's little way of knowing what each exit status means at present because it's not documented. I'm assuming they are the same as docker run. Signed-off-by: Eric Curtin (cherry picked from commit 23670968ccfb985bc977947adb24d1f2824f5d6b) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 27ab7cc3d6668d8e4bfca8fe9c60020b8dbc131c Component: cli --- components/cli/man/src/container/exec.md | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/components/cli/man/src/container/exec.md b/components/cli/man/src/container/exec.md index 033db426b8..c597817eea 100644 --- a/components/cli/man/src/container/exec.md +++ b/components/cli/man/src/container/exec.md @@ -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 + From e9e7044d8990ec4578c157976e6261879aa9c6ac Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Mon, 18 Mar 2019 12:32:48 +0100 Subject: [PATCH 14/14] Add some spaces for cosmetics and readability reasons. Signed-off-by: Silvin Lubecki (cherry picked from commit 8401c81b46549ce81a5cf0693019cef89da0dfdb) Signed-off-by: Sebastiaan van Stijn Upstream-commit: c1a4358ea4b88045a01097be9abff555d4203b6a Component: cli --- components/cli/docs/reference/commandline/run.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/cli/docs/reference/commandline/run.md b/components/cli/docs/reference/commandline/run.md index 754bc6d700..6a2630bd19 100644 --- a/components/cli/docs/reference/commandline/run.md +++ b/components/cli/docs/reference/commandline/run.md @@ -717,11 +717,11 @@ $ 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 older than Windows 10 1809). | -| `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 isolation on Windows client operating systems is `hyperv`. An attempt to start a container on a client