Skip to content

Instantly share code, notes, and snippets.

@ArturT
Created January 14, 2015 14:37
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 ArturT/f650813c7035cce7dce9 to your computer and use it in GitHub Desktop.
Save ArturT/f650813c7035cce7dce9 to your computer and use it in GitHub Desktop.
Script to stop all docker containers
#!/bin/sh
CONTAINERS=`docker ps -q`
echo $CONTAINERS
if [ "$CONTAINERS" == "" ];
then
echo no running containers
else
echo containers exist, stopping them
docker stop $CONTAINERS
docker wait $CONTAINERS
echo Containers stopped
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment