Created
March 8, 2016 18:59
-
-
Save clintkitson/d4825d4889429d763465 to your computer and use it in GitHub Desktop.
docker-machine swarm
This file contains 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
eval $(docker-machine env manager) | |
TOKEN=$(docker run --rm swarm create) | |
docker-machine create --driver=virtualbox --swarm --swarm-master --swarm-discovery token://$TOKEN manager | |
docker-machine create --driver=virtualbox --swarm --swarm-discovery token://$TOKEN agent1 | |
docker-machine create --driver=virtualbox --swarm --swarm-discovery token://$TOKEN agent2 | |
for each in $(echo -e "manager\nagent1\nagent2\n"); do docker-machine ssh $each "curl -sSL https://dl.bintray.com/emccode/rexray/install | sh -s stable" ; done | |
for each in $(echo -e "manager\nagent1\nagent2\n"); do docker-machine ssh $each "sudo tee -a /etc/rexray/config.yml << EOF | |
rexray: | |
logLevel: debug | |
storageDrivers: | |
- virtualbox | |
volume: | |
mount: | |
preempt: false | |
virtualbox: | |
endpoint: http://10.0.2.2:18083 | |
tls: false | |
volumePath: /Users/clintonkitson/VirtualBox Volumes | |
controllerName: SATA | |
" ; done | |
for each in $(echo -e "manager\nagent1\nagent2\n"); do docker-machine ssh $each "sudo rexray start" ; done | |
eval $(docker-machine env manager) | |
DOCKER_HOST=$(docker-machine ip manager):3376 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment