How to remove <none> images after building

It won’t work if the ‘docker images -a’ list with different order in the future, however , the command can delete “<none>” tagged images below.

docker rmi $(docker images -a|grep "<none>"|awk '$1=="<none>" {print $3}')
2 Likes