Listing images with a specific label
I have a large and growing collection of docker images. If I want to restrict the list output to just those images with a particular label, I can do that with the
--filter option of the
docker images command.
Here's an example that lists only images that have a specific label key. This filter specifies the label "net.develves.examples"; I use that for images I create to try out an example or exercise from a book or tutorial.
docker images --filter "label=net.develves.examples"
This example lists only images with a label key of a specific value. This filter specifies just the example images I've associated with a particular book.
docker images --filter "label=net.develves.examples=flask-web-development-book"
© 2016 Dave Hein
This work by Dave Hein is licensed under a Creative Commons Attribution 4.0 International License.