# Remove all containers that aren't running.
docker rm -vf $(docker ps -a -q --filter "status=exited")
# Remove untagged images.
docker rmi -f $(docker images -q -f "dangling=true")
# Remove unused volumes using "rm" or "prune".
docker volume rm -f $(docker volume ls -f "dangling=true")
docker volume prune -f
# Remove unused networks.
docker network prune -f