Skip to content

Instantly share code, notes, and snippets.

@micwehrle
Created November 16, 2015 04:08
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 micwehrle/38e0fcbffedf1f9c75d3 to your computer and use it in GitHub Desktop.
Save micwehrle/38e0fcbffedf1f9c75d3 to your computer and use it in GitHub Desktop.
Remove docker containers based on image name
#!/bin/bash
IMAGE=$1
docker ps -a | awk '{ print $1,$2 }' | grep $IMAGE | awk '{print $1 }' | xargs -I {} docker rm {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment