Last active
October 31, 2024 09:53
-
-
Save fordnox/b1c387688bf5cc7abfca0a0e8afc351a to your computer and use it in GitHub Desktop.
clean all docker shit makefile target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clean: | |
docker stop $$(docker ps -aq) || true | |
docker rm $$(docker ps -aq) || true | |
docker container prune -f || true | |
docker rmi $$(docker images -q) || true | |
docker image prune -f || true | |
docker volume rm $$(docker volume ls -q) || true | |
docker-prune: ## Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes. | |
docker container prune -f | |
docker image prune -a -f | |
docker network prune -f | |
docker volume prune -f | |
docker builder prune -f | |
docker system prune -a -f | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment