Docker Community Forums

Share and learn in the Docker community.

Do multiple docker filter options perform a local AND or OR operation?


I am trying to perform a prune operation with multiple filters. This is covered in the docs here:

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 docs fail to mention if using multiple filters like this combining them using a logical AND or OR operation.

I would like it to be an AND operation so that I can do something like this:

docker image prune --all --force --filter="" \

and a Dockerfile with the following labels would not be pruned:


Is this possible?


After doing some testing it appears to be an AND operation, so something like this should work:

docker image prune --all --force --filter="" \