Skip to content

Instantly share code, notes, and snippets.

@fragmede
Created January 13, 2016 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fragmede/1ed976912f29f2f76cee to your computer and use it in GitHub Desktop.
Save fragmede/1ed976912f29f2f76cee to your computer and use it in GitHub Desktop.
my script to cleanup stale docker images.
#!/bin/bash
df -h /
docker rm $(docker ps -a -q)
# add -a to 'docker images' for nested but those usually fail.
docker rmi $(docker images | grep "^<none>" | awk '{print $3}' )
df -h /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment