From 14be084edbf9b67cda9a8ff6c89a0f54205e3092 Mon Sep 17 00:00:00 2001 From: "J. Casalino" Date: Thu, 26 Oct 2023 15:49:38 -0400 Subject: [PATCH] Add filtering section on docker system prune (#18519) * Add filtering section on docker system prune Docker system prune is allowed for API 1.28+, as shown in the doc https://docs.docker.com/engine/reference/commandline/system_prune/, but this is not shown in the Prune unused objects page. * Remove disclaimer per suggestion Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --------- Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- content/config/pruning.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/content/config/pruning.md b/content/config/pruning.md index 43fa209583..0ffe5e85ba 100644 --- a/content/config/pruning.md +++ b/content/config/pruning.md @@ -174,4 +174,16 @@ Are you sure you want to continue? [y/N] y ``` By default, you are prompted to continue. To bypass the prompt, use the `-f` or -`--force` flag. \ No newline at end of file +`--force` flag. + +By default, all unused containers, networks, images (both dangling and unreferenced) +are removed. You can limit the scope using the +`--filter` flag. For instance, the following command removes items older than 24 hours: + +```console +$ docker system prune --filter "until=24h" +``` + +Other filtering expressions are available. See the +[`docker system prune` reference](../engine/reference/commandline/system_prune.md) +for more examples.