Skip to content

Instantly share code, notes, and snippets.

@damnit
Created October 8, 2015 10:56
Show Gist options
  • Save damnit/37ae83a79a8e9eb65235 to your computer and use it in GitHub Desktop.
Save damnit/37ae83a79a8e9eb65235 to your computer and use it in GitHub Desktop.
#!/bin/bash
# delete all containers matching a $1
docker ps -a | grep $1 | awk '{print $1}' | xargs docker rm
# delete all "<none>" image-pollution by docker-compose
docker images | grep \<none\> | awk '{print $3}' | xargs sudo docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment