Skip to content

Instantly share code, notes, and snippets.

@fordnox
Last active October 31, 2024 09:53
Show Gist options
  • Save fordnox/b1c387688bf5cc7abfca0a0e8afc351a to your computer and use it in GitHub Desktop.
Save fordnox/b1c387688bf5cc7abfca0a0e8afc351a to your computer and use it in GitHub Desktop.
clean all docker shit makefile target
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