May 8, 2018 I wrote this four years ago, so instead use this command: $ docker rmi $(docker images -q -f dangling=true)
Shorter :)
docker image prune
.