Last active
August 14, 2016 04:37
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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