Skip to content

Instantly share code, notes, and snippets.

@jamesbrink
Last active January 2, 2016 07:48
Show Gist options
  • Save jamesbrink/8271949 to your computer and use it in GitHub Desktop.
Save jamesbrink/8271949 to your computer and use it in GitHub Desktop.
clear out all docker crap
docker ps -a|grep -v "CONTAINER ID"|awk '{print $1}'|xargs docker rm && docker images|grep -v REPOSITORY|awk '{print $3'}|xargs docker rmi
docker ps -a |grep Exited|grep -v "CONTAINER ID"|awk '{print $1}'|xargs docker rm && docker images|grep -v REPOSITORY|awk '{print $3'}|xargs docker rmi
# Kill only exited containers and images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment