Skip to content

Instantly share code, notes, and snippets.

@bahelms
Created January 8, 2016 14:00
Show Gist options
  • Save bahelms/bd63299fd848756a06ab to your computer and use it in GitHub Desktop.
Save bahelms/bd63299fd848756a06ab to your computer and use it in GitHub Desktop.
Docker clean up tasks
# The grep regex determines what you actually remove
# Remove old containers
docker ps -a | grep "\(weeks\|hours\) ago" | awk '{print $1}' | xargs docker rm
# Remove images without tags
docker images | grep "^<none>" | awk '{print $3}' | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment