Credits: https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
Docker provides a single command that will clean up any resources — images, containers, volumes, and networks — that are dangling (not tagged or associated with a container). To additionally remove any stopped containers and all unused images (not just dangling images), add the -a flag to the command:
docker system prune -a