Deleting Many Docker Images at Once

Using awk

vITraining Admin

Suppose that we have so many docker images on our local computer as a result of building many versions of images...


Show all images that contains "myimage":

docker images | grep myimages


Get only IMAGE ID column (the 3rd column):

docker images | grep myimages | awk {'print $3'}


Force delete images with those ID:

docker images | grep myimages | awk {'print $3'} | xargs docker rmi --force