These are a set of commands, which comes in handy when you are running out of disk space, or simply want to clean up your docker host.
Removing all stopped containers and unused images
To remove all unused containers, networks, images (all unused), and optionally, volumes, run the docker system prune command:
docker system prune
References
- Docker system prune – https://docs.docker.com/engine/reference/commandline/system_prune/