Skip to content

Instantly share code, notes, and snippets.

@philipjkim
Created October 26, 2016 01:26
Show Gist options
  • Save philipjkim/eba0e27e095b961b59383a0b881eb550 to your computer and use it in GitHub Desktop.
Save philipjkim/eba0e27e095b961b59383a0b881eb550 to your computer and use it in GitHub Desktop.
Docker clean-up
#!/bin/sh
# Reference: http://blog.yohanliyanage.com/2015/05/docker-clean-up-after-yourself/
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment