Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Issue a Docker command to all active containers
#!/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
You can’t perform that action at this time.