unified and reworked docker container actions
This commit is contained in:
22
scripts/dockerContainerAction.sh
Normal file
22
scripts/dockerContainerAction.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
upDownContainers() {
|
||||
# evaluate options through given arguments
|
||||
docker_root=~/docker;
|
||||
while [[ $# > 0 ]]; do
|
||||
case $1 in
|
||||
-d | --dir) docker_root=$2; shift 2;;
|
||||
* ) break ;; # Anything else stops command line processing.
|
||||
esac
|
||||
done
|
||||
|
||||
for subdir in $docker_root/*; do
|
||||
if [[ !(-d $subdir) ]]; then
|
||||
continue;
|
||||
fi
|
||||
cd $subdir;
|
||||
docker-compose $@;
|
||||
done
|
||||
}
|
||||
|
Reference in New Issue
Block a user