I’ve been using Docker a lot at work for development. This leads to a pile-up of images on the server. In order to clear them out I made this handy little script.
!#/usr/bin/bash docker rm -f $(docker ps -a -q) docker rmi -f $(docker images -q)
This will remove all images even attached ones on your system. Be aware that running this on production or a shared development environment will result in tears and loss of joy.