Skip to content

Instantly share code, notes, and snippets.

@jmshal
Created February 9, 2016 03:42
Show Gist options
  • Save jmshal/ca78106a7db26f23afc5 to your computer and use it in GitHub Desktop.
Save jmshal/ca78106a7db26f23afc5 to your computer and use it in GitHub Desktop.
docker-machine create -d virtualbox swarm-manager
manager_ip=$(docker-machine ip swarm-manager)
manager_config=$(docker-machine config swarm-manager)
docker-machine create -d virtualbox swarm-agent-1
agent1_ip=$(docker-machine ip swarm-agent-1)
agent1_config=$(docker-machine config swarm-agent-1)
docker-machine create -d virtualbox swarm-agent-2
agent2_ip=$(docker-machine ip swarm-agent-2)
agent2_config=$(docker-machine config swarm-agent-2)
cluster_id=$(docker $manager_config run --rm swarm create)
docker $manager_config run -d -p 2375:2375 -t swarm manage token://$cluster_id
docker $agent1_config run -d swarm join --addr=$agent1_ip:2375 token://$cluster_id
docker $agent2_config run -d swarm join --addr=$agent2_ip:2375 token://$cluster_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment