Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve documentation for "prune" commands specifying multiple (label) filters #5899

Open
thaJeztah opened this issue Mar 6, 2025 · 0 comments

Comments

@thaJeztah
Copy link
Member

Description

This got in through the docs.docker.com feedback form;

The line " If there is more than one filter, then pass multiple flags (e.g., --filter "foo=bar" --filter "bif=baz")" unfortunately does NOT say if multiple filters are ANDed or ORed. For prune commands, this is very important, though.

It was reported for docker volume prune, but likely the same applies to other prune commands;
https://docs.docker.com/reference/cli/docker/volume/prune/

### <a name="filter"></a> Filtering (--filter)
The filtering flag (`--filter`) format is of "key=value". If there is more
than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
The currently supported filters are:
* label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove volumes with (or without, in case `label!=...` is used) the specified labels.
The `label` filter accepts two formats. One is the `label=...` (`label=<key>` or `label=<key>=<value>`),
which removes volumes with the specified labels. The other
format is the `label!=...` (`label!=<key>` or `label!=<key>=<value>`), which removes
volumes without the specified labels.

We need to verify the behavior (behavior of some of the filter options haven't been documented well when combined with other filters, or same filter applied multiple times), and update the documentation accordingly to make it less ambiguous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant