Skip to content

Instantly share code, notes, and snippets.

@martint17r
Created June 2, 2014 13:09
Show Gist options
  • Save martint17r/c7bbf24859a7859dceae to your computer and use it in GitHub Desktop.
Save martint17r/c7bbf24859a7859dceae to your computer and use it in GitHub Desktop.
Script to clean up docker leftovers periodically
#!/bin/bash
# adapted from http://jimhoskins.com/2013/07/27/remove-untagged-docker-images.html
docker rm $(docker ps -a -q)
docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment