Skip to content

Instantly share code, notes, and snippets.

@tobiashm
Created August 25, 2016 13:09
Show Gist options
  • Save tobiashm/58121bc8245a4774675cea30d41fb84f to your computer and use it in GitHub Desktop.
Save tobiashm/58121bc8245a4774675cea30d41fb84f to your computer and use it in GitHub Desktop.
Docker prune unused containers, images, and volumes
#!/bin/bash
docker rm -v $(docker ps -q --filter status=dead --filter status=exited)
docker rmi $(docker images -qf "dangling=true")
docker volume rm $(docker volume ls -qf "dangling=true")
@tobiashm
Copy link
Author

Now you can just do docker system prune 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment