docker-scripts/docker-clean-all

10 lines
282 B
Plaintext
Raw Normal View History

2023-02-08 19:46:00 +00:00
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi -f
# remove unused volumes:
docker volume prune -f