Skip to content

Instantly share code, notes, and snippets.

@musghost
Created October 22, 2016 19:38
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 musghost/f2e63d3e561b804bb0290c931c0d1ec3 to your computer and use it in GitHub Desktop.
Save musghost/f2e63d3e561b804bb0290c931c0d1ec3 to your computer and use it in GitHub Desktop.
SWARM_TOKEN=$(docker run swarm create)
echo $SWARM_TOKEN
docker-machine create -d virtualbox --engine-label datacenter=mex --swarm --swarm-master --swarm-discovery token://$SWARM_TOKEN master
docker-machine create -d virtualbox --engine-label datacenter=usa --swarm --swarm-discovery token://$SWARM_TOKEN node1
docker-machine create -d virtualbox --engine-label datacenter=mex --swarm --swarm-discovery token://$SWARM_TOKEN node2
curl https://discovery-stage.hub.docker.com/v1/clusters/$SWARM_TOKEN
docker run swarm list token://$SWARM_TOKEN
eval $(docker-machine env --swarm master)
docker info
docker run -d debian sleep 10
docker ps
docker run -d -p 80:80 nginx
docker run -d -p 80:80 nginx
docker ps
docker run -d -p 80:80 nginx
docker run -d -e constraint:datacenter==usa postgres
docker ps
docker run -d -e constraint:datacenter==mex postgres
docker ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment