I want to list all images with the tag foo
, regardless of repository name.
What I’ve tried:
docker images --filter=reference='*:foo'
With the following images on the daemon:
x/y/z:foo
y/z:foo
z:foo
.. the above command will list only the z:foo
image.
I cannot find anywhere documented how the Docker CLI interprets these wildcards. I’ve found other answers, where people state that you generally need to look into the Go code for that (?!). For example, in order to realize that the *
wildcard will not match the /
character. As long as it is not documented, I guess it is urban legend, although I can reproduce it.
In any case, I’ll restate the question:
How to list all images on docker daemon with tag name foo
, regardless of repository name.
2
Answers
You can always pipe output to other tools, like
awk
:@Justinas has already given a good answer, but to elaborate on the
docker images --filter=reference
wildcard, it does not match/
, but if you really want to use it you can use multiple filters: