Created
          October 19, 2015 20:18 
        
      - 
      
- 
        Save dave-tucker/22af54b6b0ff59fad9a5 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | #!/bin/bash | |
| set -e | |
| # Docker Machine Setup | |
| docker-machine create \ | |
| -d virtualbox \ | |
| mh-consul | |
| docker $(docker-machine config mh-consul) run -d \ | |
| -p "8500:8500" \ | |
| -h "consul" \ | |
| progrium/consul -server -bootstrap | |
| docker-machine create \ | |
| -d virtualbox \ | |
| --virtualbox-boot2docker-url https://github.com/tianon/boot2docker-legacy/releases/download/v1.9.0-rc1/boot2docker.iso \ | |
| --engine-opt="cluster-store=consul://$(docker-machine ip mh-consul):8500" \ | |
| mh-demo0 | |
| docker-machine create \ | |
| -d virtualbox \ | |
| --virtualbox-boot2docker-url https://github.com/tianon/boot2docker-legacy/releases/download/v1.9.0-rc1/boot2docker.iso \ | |
| --engine-opt="cluster-store=consul://$(docker-machine ip mh-consul):8500" \ | |
| mh-demo1 | |
| # Workaround for https://github.com/docker/docker/issues/17047 | |
| docker-machine ssh mh-demo0 'sudo sh -c "set -ex; /etc/init.d/docker stop || true; sed -i '\''5i --cluster-advertise='$(docker-machine ip mh-demo0)':0\"'\'' /var/lib/boot2docker/profile; /etc/init.d/docker start"' | |
| docker-machine ssh mh-demo1 'sudo sh -c "set -ex; /etc/init.d/docker stop || true; sed -i '\''5i --cluster-advertise='$(docker-machine ip mh-demo1)':0\"'\'' /var/lib/boot2docker/profile; /etc/init.d/docker start"' | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment