Find dangling images
docker images -a -f dangling=true
Remove them
docker rmi $(docker images -a -f dangling=true -q)
or
docker images purge
Find exited containers
docker ps -a -f status=exited
Remove them
docker rm -f $(docker ps -a -f status=exited -q)
Remove dandling images, containers, volumes, networks
docker system prune