Skip to content

Instantly share code, notes, and snippets.

@VanDavv
Created June 8, 2017 20:53
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 VanDavv/04be4a6709380017388d8a816a97f4c7 to your computer and use it in GitHub Desktop.
Save VanDavv/04be4a6709380017388d8a816a97f4c7 to your computer and use it in GitHub Desktop.
One-liner to remove docker containers that returned with non 0 code
docker rm $(docker ps -a --format "table {{.ID}}\t{{.Status}}" | grep -v "Exited (0)" | awk '{print $1}' | grep -v "CONTAINER")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment