Skip to content

Instantly share code, notes, and snippets.

@ihortymoshenko
Created October 27, 2015 15:19
Show Gist options
  • Save ihortymoshenko/8a6608867a3e740539bb to your computer and use it in GitHub Desktop.
Save ihortymoshenko/8a6608867a3e740539bb to your computer and use it in GitHub Desktop.
Docker clean up after yourself
#!/bin/bash
# http://blog.yohanliyanage.com/2015/05/docker-clean-up-after-yourself/
docker rm -v $(docker ps -a -f status=exited -q)
docker rmi $(docker images -f "dangling=true" -q)
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker martin/docker-cleanup-volumes
@tkachuk
Copy link

tkachuk commented Feb 16, 2018

Cool note! : )

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