These are handy commands:

docker rm $(docker ps --filter exited=0 -a -q)
docker rm $(docker ps --filter exited=100 -a -q)
docker rm $(docker ps --filter exited=127 -a -q)
docker rmi $(docker images --filter dangling=true -q)

Add more later.