Created
January 14, 2015 14:37
-
-
Save ArturT/f650813c7035cce7dce9 to your computer and use it in GitHub Desktop.
Script to stop all docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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