Skip to content

Instantly share code, notes, and snippets.

@jeygeethan
Last active August 14, 2016 04:37
Show Gist options
  • Save jeygeethan/bbcb991439b611f7e125cb17805898a7 to your computer and use it in GitHub Desktop.
Save jeygeethan/bbcb991439b611f7e125cb17805898a7 to your computer and use it in GitHub Desktop.
a script file to create docker engines across a few hosts and join them as nodes
#!/usr/sh
#change these values as necessary
set SWARM_TOKEN=insert_token_here
set SWARM_MANAGE_HOST=10.0.0.4
# install docker-engine on the current machine
sudo apt-get update && sudo apt-get install -y docker-engine && sudo service docker start && sudo docker run hello-world && sudo usermod -aG docker $USER
# join the docker engine to a swarm
docker swarm join \
--token $SWARM_TOKEN \
$SWARM_MANAGER_HOST:2377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment