Cleanup old docker volumes and images


Remove old images:

docker images -q --no-trunc --filter dangling=true | xargs --no-run-if-empty docker rmi -f

Delete all dangling volumes:

docker volume ls -qf dangling=true | xargs --no-run-if-empty docker volume rm

On newer Docker versions:

docker image prune
docker volume prune

Or clean all in one command:

docker system prune