Skip to content

Instantly share code, notes, and snippets.

@ik5 ik5/run-workers.sh
Created Jul 26, 2019

Embed
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"\
local/worker:latest\
/bin/bash -c "worker -queue-number $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.