cli icon indicating copy to clipboard operation
cli copied to clipboard

Clarify "reference" in filters for `docker images`

Open 0cjs opened this issue 3 years ago • 1 comments

This is possibly related to (though not the same as) #1332, "docker images --filter=reference giving seemingly unpredictable results." It's a copy of issue #7618 in docker/docker.github.io which was just now closed because I'm told it belongs here. Note that #1332 and this issue date from late 2018 with no response, yet still seem to be relevant.

There's no clear explanation of how to filter based on repository or tag. We can filter by "reference," which seems to do something similar, but it doesn't seem to work intuitively: dr images -f reference=*acme* will not list images with a repository field of docker-registry.ec2-1.acme.com:5000/acme/user.

The documentation should explain what a "reference" is how it relates to the repository and tag.

0cjs avatar Jun 05 '22 03:06 0cjs

Need a way to use reference patterns which include slashes. Otherwise if you have variable number of slashes in your names, the filtering is basically unusable. For example I just had to write the following rather ridiculous statement.

docker image ls --filter reference="*:*SNAPSHOT" --filter reference="*/*:*SNAPSHOT" --filter reference="*/*/*:*SNAPSHOT"

k1w1m8 avatar Oct 05 '22 05:10 k1w1m8