Skip to content

Instantly share code, notes, and snippets.

@nhoening
Created August 20, 2014 14:14
Show Gist options
  • Save nhoening/136e76c73975e6792596 to your computer and use it in GitHub Desktop.
Save nhoening/136e76c73975e6792596 to your computer and use it in GitHub Desktop.
stop and remove all docker containers, don't fail if there are none (good for jenkins)
if [ "$(docker ps | wc -l)" == "1" ]; then docker stop $(docker ps -a); fi
if [ "$(docker ps -a | wc -l)" == "1" ]; then docker rm $(docker ps -a); fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment