Remove Docker images with no tag

Sometimes, particularly on a development environment, you can end up with a lot of Docker images with no tags, which aren’t much practical use. To get rid of them you can do:

docker rmi $(docker images | grep none | awk '{ print $3 }')

Ones in use or with child images will not be deleted and result in output warning, but the rest will be removed so you can deal with the remaining ones as needed.

Leave a Reply