From c4e5fd7e53a5a3dc89734c391099aed8b8a0b795 Mon Sep 17 00:00:00 2001 From: Forest Johnson Date: Wed, 27 Feb 2019 15:03:09 -0600 Subject: [PATCH 1/7] Explain -s flag on docker ps https://github.com/docker/docker.github.io/issues/1520#issuecomment-467971886 Signed-off-by: Forest Johnson Signed-off-by: Sebastiaan van Stijn (cherry picked from commit f7ab2987c39162cd47c2f1738d1590e7226b5537) Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/ps.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/reference/commandline/ps.md b/docs/reference/commandline/ps.md index e073c05970..ddb8f7d736 100644 --- a/docs/reference/commandline/ps.md +++ b/docs/reference/commandline/ps.md @@ -75,6 +75,22 @@ $ docker ps -a container that exposes TCP ports `100, 101, 102` displays `100-102/tcp` in the `PORTS` column. +### Show disk usage by container + +The `docker ps -s` command displays two different on-disk-sizes for each container: + +```bash +$ docker ps -s +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE SIZE +e90b8831a4b8 nginx "/bin/bash -c 'mkdir " 11 weeks ago Up 4 hours my_nginx 35.58 kB (virtual 109.2 MB) +00c6131c5e30 telegraf:1.5 "/entrypoint.sh" 11 weeks ago Up 11 weeks my_telegraf 0 B (virtual 209.5 MB) +``` + * The "size" information shows the amount of data (on disk) that is used for the _writable_ layer of each container + * The "virtual size" is the total amount of disk-space used for the read-only _image_ data used by the container and the writable layer. + +For more information, refer to the [container size on disk](https://docs.docker.com/storage/storagedriver/#container-size-on-disk) section. + + ### Filtering The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more @@ -431,4 +447,4 @@ a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd 01946d9d34d8 c1d3b0166030 com.docker.swarm.node=debian,com.docker.swarm.cpu=6 41d50ecd2f57 com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd -``` \ No newline at end of file +``` From 66f8d279c1dc7f0c18b05c6dc8b39a79b5c18fdf Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Mon, 22 Jul 2019 16:20:13 +0100 Subject: [PATCH 2/7] builder.md: Correct copy/paste error Signed-off-by: Daniel Cassidy (cherry picked from commit e9ada56a888a042476f370d2de45b0633f7f85f6) Signed-off-by: Sebastiaan van Stijn --- docs/reference/builder.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 6b55151fb7..2b24052255 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -1720,8 +1720,8 @@ The following `ARG` variables are set automatically: * `TARGETVARIANT` - variant component of TARGETPLATFORM * `BUILDPLATFORM` - platform of the node performing the build. * `BUILDOS` - OS component of BUILDPLATFORM -* `BUILDARCH` - OS component of BUILDPLATFORM -* `BUILDVARIANT` - OS component of BUILDPLATFORM +* `BUILDARCH` - architecture component of BUILDPLATFORM +* `BUILDVARIANT` - variant component of BUILDPLATFORM These arguments are defined in the global scope so are not automatically available inside build stages or for your `RUN` commands. To expose one of From a90e5598a4acb89e45730c418520dba5eee6e58c Mon Sep 17 00:00:00 2001 From: Odin Ugedal Date: Sun, 18 Aug 2019 13:54:29 +0200 Subject: [PATCH 3/7] Fix phrasing when referring to the freezer cgroup Signed-off-by: Odin Ugedal (cherry picked from commit a0dd6e025d6d18527931a24b9e7d71132c47e601) Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/pause.md | 6 +++--- docs/reference/commandline/unpause.md | 4 ++-- man/src/container/pause.md | 6 +++--- man/src/container/unpause.md | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/reference/commandline/pause.md b/docs/reference/commandline/pause.md index 91eb0a3376..5bca9f020c 100644 --- a/docs/reference/commandline/pause.md +++ b/docs/reference/commandline/pause.md @@ -27,14 +27,14 @@ Options: ## Description The `docker pause` command suspends all processes in the specified containers. -On Linux, this uses the cgroups freezer. Traditionally, when suspending a process +On Linux, this uses the freezer cgroup. Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. -With the cgroups freezer the process is unaware, and unable to capture, +With the freezer cgroup the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. On Windows, only Hyper-V containers can be paused. See the -[cgroups freezer documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) +[freezer cgroup documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for further details. ## Examples diff --git a/docs/reference/commandline/unpause.md b/docs/reference/commandline/unpause.md index 90ce391004..9084626f69 100644 --- a/docs/reference/commandline/unpause.md +++ b/docs/reference/commandline/unpause.md @@ -27,10 +27,10 @@ Options: ## Description The `docker unpause` command un-suspends all processes in the specified containers. -On Linux, it does this using the cgroups freezer. +On Linux, it does this using the freezer cgroup. See the -[cgroups freezer documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) +[freezer cgroup documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for further details. ## Examples diff --git a/man/src/container/pause.md b/man/src/container/pause.md index 09ea5b93d2..a99023eb64 100644 --- a/man/src/container/pause.md +++ b/man/src/container/pause.md @@ -1,11 +1,11 @@ The `docker container pause` command suspends all processes in the specified containers. -On Linux, this uses the cgroups freezer. Traditionally, when suspending a process +On Linux, this uses the freezer cgroup. Traditionally, when suspending a process the `SIGSTOP` signal is used, which is observable by the process being suspended. -With the cgroups freezer the process is unaware, and unable to capture, +With the freezer cgroup the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. On Windows, only Hyper-V containers can be paused. -See the [cgroups freezer documentation] +See the [freezer cgroup documentation] (https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for further details. diff --git a/man/src/container/unpause.md b/man/src/container/unpause.md index 0e77ceed6b..8eea3b799d 100644 --- a/man/src/container/unpause.md +++ b/man/src/container/unpause.md @@ -1,6 +1,6 @@ The `docker container unpause` command un-suspends all processes in a container. -On Linux, it does this using the cgroups freezer. +On Linux, it does this using the freezer cgroup. -See the [cgroups freezer documentation] +See the [freezer cgroup documentation] (https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for further details. From df5c7130df9b81548ff5c27528c11e4696550cca Mon Sep 17 00:00:00 2001 From: Daniel Artine Date: Thu, 29 Aug 2019 14:35:28 -0300 Subject: [PATCH 4/7] Updating deprecated command example in search.md --stars example is deprecated. Changing to --filter=stars=5 Signed-off-by: danielartine (cherry picked from commit bba0a4d5ac225a28eb0bd1b14a086f7197e8d762) Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/search.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/commandline/search.md b/docs/reference/commandline/search.md index 65f2d314f0..d009cbae0f 100644 --- a/docs/reference/commandline/search.md +++ b/docs/reference/commandline/search.md @@ -83,7 +83,7 @@ This example displays images with a name containing 'busybox', at least 3 stars and the description isn't truncated in the output: ```bash -$ docker search --stars=3 --no-trunc busybox +$ docker search --filter=stars=3 --no-trunc busybox NAME DESCRIPTION STARS OFFICIAL AUTOMATED busybox Busybox base image. 325 [OK] progrium/busybox 50 [OK] From aa45ea366c18ae1265c5e3910d7f7b22b9e4c0dd Mon Sep 17 00:00:00 2001 From: Adrian Plata Date: Mon, 7 Oct 2019 15:29:19 -0700 Subject: [PATCH 5/7] Minor formatting changes and a typo fix. Signed-off-by: Adrian Plata (cherry picked from commit ba7ec36de2c5c83d689f5d2e1f3e0d209606d8c3) Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/cli.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/commandline/cli.md b/docs/reference/commandline/cli.md index 8df7da70e5..6ef4507b3d 100644 --- a/docs/reference/commandline/cli.md +++ b/docs/reference/commandline/cli.md @@ -54,7 +54,7 @@ each `docker` command with `sudo`. To avoid having to use `sudo` with the For more information about installing Docker or `sudo` configuration, refer to the [installation](https://docs.docker.com/install/) instructions for your operating system. -### Environment variables +## Environment variables For easy reference, the following list of environment variables are supported by the `docker` command line: @@ -99,7 +99,7 @@ By default, the Docker command line stores its configuration files in a directory called `.docker` within your `$HOME` directory. Docker manages most of the files in the configuration directory -and you should not modify them. However, you *can modify* the +and you should not modify them. However, you *can* modify the `config.json` file to control certain aspects of how the `docker` command behaves. @@ -111,12 +111,12 @@ variable. Command line options override environment variables and environment variables override properties you specify in a `config.json` file. -#### Change the `.docker` directory +### Change the `.docker` directory To specify a different directory, use the `DOCKER_CONFIG` environment variable or the `--config` command line option. If both are specified, then the `--config` option overrides the `DOCKER_CONFIG` environment -variable. The example below overrides runs the `docker ps` command using a +variable. The example below overrides the `docker ps` command using a `config.json` file located in the `~/testconfigs/` directory. ```bash @@ -132,7 +132,7 @@ directory to be `HOME/newdir/.docker`. echo export DOCKER_CONFIG=$HOME/newdir/.docker > ~/.profile ``` -#### `config.json` properties +### `config.json` properties The `config.json` file stores a JSON encoding of several properties: From c050ae7fb168a9dd5cb8a65a72cc7d2ec7993cda Mon Sep 17 00:00:00 2001 From: Brandon Mitchell Date: Thu, 10 Oct 2019 17:03:48 -0400 Subject: [PATCH 6/7] Adjusting glossary reference and clarrifying the start of a Dockerfile Signed-off-by: Brandon Mitchell (cherry picked from commit 937ce69b4251d355db64eb88715ced76ed04b157) Signed-off-by: Sebastiaan van Stijn --- docs/reference/builder.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 2b24052255..c400bafbd5 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -157,10 +157,12 @@ be UPPERCASE to distinguish them from arguments more easily. Docker runs instructions in a `Dockerfile` in order. A `Dockerfile` **must -start with a \`FROM\` instruction**. The `FROM` instruction specifies the [*Base -Image*](glossary.md#base-image) from which you are building. `FROM` may only be -preceded by one or more `ARG` instructions, which declare arguments that are used -in `FROM` lines in the `Dockerfile`. +begin with a \`FROM\` instruction**. This may be after [parser +directives](#parser-directives), [comments](#format), and globally scoped +[ARGs](#arg). The `FROM` instruction specifies the [*Parent +Image*](glossary.md#parent-image) from which you are building. `FROM` +may only be preceded by one or more `ARG` instructions, which declare arguments +that are used in `FROM` lines in the `Dockerfile`. Docker treats lines that *begin* with `#` as a comment, unless the line is a valid [parser directive](#parser-directives). A `#` marker anywhere From 9597e681cb1273616b2657662227df57b469c711 Mon Sep 17 00:00:00 2001 From: Daniel Helfand Date: Wed, 23 Oct 2019 17:21:43 -0400 Subject: [PATCH 7/7] update Jenkins Build Status urls for README Signed-off-by: danielhelfand (cherry picked from commit 46f3f9ac047bc5d4fe22183275b4e25d91870608) Signed-off-by: Sebastiaan van Stijn --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2964377ea1..e21bccec0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![build status](https://circleci.com/gh/docker/cli.svg?style=shield)](https://circleci.com/gh/docker/cli/tree/master) [![Build Status](https://jenkins.dockerproject.org/job/docker/job/cli/job/master/badge/icon)](https://jenkins.dockerproject.org/job/docker/job/cli/job/master/) +[![build status](https://circleci.com/gh/docker/cli.svg?style=shield)](https://circleci.com/gh/docker/cli/tree/master) +[![Build Status](https://ci.docker.com/public/job/cli/job/master/badge/icon)](https://ci.docker.com/public/job/cli/job/master) docker/cli ==========