I have some automated processes that spew a bunch of Docker images tagged with meaningful labels. The labels follow a structured pattern.
Is there a way to find and
Fun with bash:
docker rmi $(docker images | grep stuff_ | tr -s ' ' | cut -d ' ' -f 3)
Using only docker filtering:
docker rmi $(docker images --filter=reference="*:stuff_*" -q)
reference="*:stuff_*"
filter allows you to filter images using a wildcard;-q
option is for displaying only image IDs.