Last active
March 2, 2016 08:25
-
-
Save davidmnoriega/4299a9f80d14deb0b19c to your computer and use it in GitHub Desktop.
Create backend supporting infrastructure for local development
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
#!/bin/bash | |
# Inspiration | |
# Patrick Chanezon | |
# https://github.com/chanezon/docker-tips/blob/master/orchestration-networking/swarm-local.sh | |
docker-machine create \ | |
-d virtualbox \ | |
consul | |
docker $(docker-machine config consul) run -d --restart=always \ | |
-p "8500:8500" \ | |
-h "consul" \ | |
progrium/consul -server -bootstrap | |
docker-machine create \ | |
-d virtualbox \ | |
--engine-opt="cluster-store=consul://$(docker-machine ip consul):8500" \ | |
--engine-opt="cluster-advertise=eth1:0" \ | |
backend | |
sleep 2 | |
docker $(docker-machine config backend) network create -d overlay backend-network | |
# Now start any backend containers on this machine. App development can then happen in other | |
# docker-machine virts, but create using --engine-opt to join it to the backend overlay network |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment