Created
December 3, 2014 02:24
-
-
Save rafaeltuelho/7558bf1fe41c27ad964c to your computer and use it in GitHub Desktop.
Issue a Docker command to all active 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/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 start|stop|pause|unpause|<any valid docker cmd>" | |
exit 1 | |
fi | |
for c in $(sudo docker ps -a | awk '{print $1}' | sed "1 d") | |
do | |
sudo docker $1 $c | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment