Skip to content

Instantly share code, notes, and snippets.

@progrium
Last active August 29, 2015 14:05
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 progrium/6536fc89af4a7dfeb6b1 to your computer and use it in GitHub Desktop.
Save progrium/6536fc89af4a7dfeb6b1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
source ./$(dirname $BASH_SOURCE)/libs
function start_containers {
args="$@"
cat $DOCKER_CONTAINERS_FILE | grep "^${args// /\\|^}" | parallel \
--onall \
--sshloginfile docker_nodes_${ENVIRONMENT} \
--controlmaster \
--tag \
--retries 3 \
"read name image args <<< {}; docker run \$args --name \$name \$image"
}
will_cite
start_containers $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment