Skip to content

Instantly share code, notes, and snippets.

@vitor-caetano
Last active October 18, 2017 13:27
Show Gist options
  • Select an option

  • Save vitor-caetano/7c5a9b44b46bd7720bb27ddd322500a8 to your computer and use it in GitHub Desktop.

Select an option

Save vitor-caetano/7c5a9b44b46bd7720bb27ddd322500a8 to your computer and use it in GitHub Desktop.
Create swarm with a docker-machine choosing docker version
#!/usr/bin/env bash
if [[ "$(uname -s )" == "Linux" ]]; then
export VIRTUALBOX_SHARE_FOLDER="$PWD:$PWD"
fi
for i in 1 2 3; do
docker-machine create \
-d virtualbox \
--virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v17.04.0-ce/boot2docker.iso \
swarm-$i
done
eval $(docker-machine env swarm-1)
docker swarm init \
--advertise-addr $(docker-machine ip swarm-1)
TOKEN=$(docker swarm join-token -q manager)
for i in 2 3; do
eval $(docker-machine env swarm-$i)
docker swarm join \
--token $TOKEN \
--advertise-addr $(docker-machine ip swarm-$i) \
$(docker-machine ip swarm-1):2377
done
echo ">> The swarm cluster is up and running"
@vitor-caetano
Copy link
Copy Markdown
Author

Navigate to https://github.com/boot2docker/boot2docker/releases/tag/v17.04.0-ce
and copy the link address from boot2docker.iso file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment