Skip to content

Instantly share code, notes, and snippets.

@ik5 ik5/

Created Jul 26, 2019
What would you like to do?
Creating 10 workers, takes the host ip using docker
#!/usr/bin/env bash
declare -i min=0
declare -i max=10
host=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
for (( c=min; c<max; c++ )) do
echo "Going to start worker # $c"
docker run\
-e "DOCKER_HOST=$host"\
-dit \
--name "worker-$c"\
/bin/bash -c "worker -queue-number $c"
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.