Skip to content

Instantly share code, notes, and snippets.

@clintkitson
Created March 8, 2016 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clintkitson/d4825d4889429d763465 to your computer and use it in GitHub Desktop.
Save clintkitson/d4825d4889429d763465 to your computer and use it in GitHub Desktop.
docker-machine swarm
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