Last active
October 18, 2017 13:27
-
-
Save vitor-caetano/7c5a9b44b46bd7720bb27ddd322500a8 to your computer and use it in GitHub Desktop.
Create swarm with a docker-machine choosing docker version
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/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" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Navigate to https://github.com/boot2docker/boot2docker/releases/tag/v17.04.0-ce
and copy the link address from boot2docker.iso file