From 40bb4a3b0e68f32b7141a8c5ddd72b7f98cc38e2 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Mon, 10 Apr 2017 11:08:40 -0700 Subject: [PATCH] Update docs of `label` filter for `docker system prune` This fix updates docs of `label` filter for `docker system prune`. This fix is related to #30740 and #29999, and specifically to comment https://github.com/docker/docker/pull/30740#issuecomment-293012957. Signed-off-by: Yong Tang --- docs/reference/commandline/container_prune.md | 6 ++++++ docs/reference/commandline/image_prune.md | 6 ++++++ docs/reference/commandline/network_prune.md | 6 ++++++ docs/reference/commandline/system_prune.md | 6 ++++++ docs/reference/commandline/volume_prune.md | 20 +++++++++++++++++-- 5 files changed, 42 insertions(+), 2 deletions(-) diff --git a/docs/reference/commandline/container_prune.md b/docs/reference/commandline/container_prune.md index 724057cf2c..72488901ed 100644 --- a/docs/reference/commandline/container_prune.md +++ b/docs/reference/commandline/container_prune.md @@ -54,6 +54,7 @@ than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "b The currently supported filters are: * until (``) - only remove containers created before given timestamp +* label (`label=`, `label==`, `label!=`, or `label!==`) - only remove containers with (or without, in case `label!=...` is used) the specified labels. The `until` filter can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed @@ -67,6 +68,11 @@ that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a fraction of a second no more than nine digits long. +The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), +which removes containers with the specified labels. The other +format is the `label!=...` (`label!=` or `label!==`), which removes +containers without the specified labels. + The following removes containers created more than 5 minutes ago: ```bash diff --git a/docs/reference/commandline/image_prune.md b/docs/reference/commandline/image_prune.md index e9cae8c6a9..f3b1545407 100644 --- a/docs/reference/commandline/image_prune.md +++ b/docs/reference/commandline/image_prune.md @@ -76,6 +76,7 @@ than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "b The currently supported filters are: * until (``) - only remove images created before given timestamp +* label (`label=`, `label==`, `label!=`, or `label!==`) - only remove images with (or without, in case `label!=...` is used) the specified labels. The `until` filter can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed @@ -89,6 +90,11 @@ that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a fraction of a second no more than nine digits long. +The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), +which removes images with the specified labels. The other +format is the `label!=...` (`label!=` or `label!==`), which removes +images without the specified labels. + The following removes images created before `2017-01-04T00:00:00`: ```bash diff --git a/docs/reference/commandline/network_prune.md b/docs/reference/commandline/network_prune.md index 12d1caac08..9ef541061d 100644 --- a/docs/reference/commandline/network_prune.md +++ b/docs/reference/commandline/network_prune.md @@ -42,6 +42,7 @@ than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "b The currently supported filters are: * until (``) - only remove networks created before given timestamp +* label (`label=`, `label==`, `label!=`, or `label!==`) - only remove networks with (or without, in case `label!=...` is used) the specified labels. The `until` filter can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed @@ -55,6 +56,11 @@ that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a fraction of a second no more than nine digits long. +The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), +which removes networks with the specified labels. The other +format is the `label!=...` (`label!=` or `label!==`), which removes +networks without the specified labels. + The following removes networks created more than 5 minutes ago. Note that system networks such as `bridge`, `host`, and `none` will never be pruned: diff --git a/docs/reference/commandline/system_prune.md b/docs/reference/commandline/system_prune.md index 3e5ff413bc..e09fec4d7f 100644 --- a/docs/reference/commandline/system_prune.md +++ b/docs/reference/commandline/system_prune.md @@ -76,6 +76,7 @@ than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "b The currently supported filters are: * until (``) - only remove containers, images, and networks created before given timestamp +* label (`label=`, `label==`, `label!=`, or `label!==`) - only remove containers, images, networks, and volumes with (or without, in case `label!=...` is used) the specified labels. The `until` filter can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed @@ -89,6 +90,11 @@ that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a fraction of a second no more than nine digits long. +The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), +which removes containers, images, networks, and volumes with the specified labels. The other +format is the `label!=...` (`label!=` or `label!==`), which removes +containers, images, networks, and volumes without the specified labels. + ## Related commands * [volume create](volume_create.md) diff --git a/docs/reference/commandline/volume_prune.md b/docs/reference/commandline/volume_prune.md index a9c4b70fc4..7a1ae76c69 100644 --- a/docs/reference/commandline/volume_prune.md +++ b/docs/reference/commandline/volume_prune.md @@ -21,8 +21,9 @@ Usage: docker volume prune [OPTIONS] Remove all unused volumes Options: - -f, --force Do not prompt for confirmation - --help Print usage + --filter filter Provide filter values (e.g. 'label=