-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.sh
executable file
·43 lines (34 loc) · 1.16 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -ueo pipefail
docker-machine create \
-d virtualbox \
swarm-keystore
eval $(docker-machine env swarm-keystore)
docker run -d \
-p "8500:8500" \
-h "consul" \
progrium/consul -server -bootstrap
docker-machine create \
-d virtualbox \
--swarm --swarm-master \
--swarm-discovery="consul://$(docker-machine ip swarm-keystore):8500" \
--engine-opt="cluster-store=consul://$(docker-machine ip swarm-keystore):8500" \
--engine-opt="cluster-advertise=eth1:2376" \
swarm-master
docker-machine create \
-d virtualbox \
--swarm \
--swarm-discovery="consul://$(docker-machine ip swarm-keystore):8500" \
--engine-opt="cluster-store=consul://$(docker-machine ip swarm-keystore):8500" \
--engine-opt="cluster-advertise=eth1:2376" \
swarm-agent-n1
docker-machine create \
-d virtualbox \
--swarm \
--swarm-discovery="consul://$(docker-machine ip swarm-keystore):8500" \
--engine-opt="cluster-store=consul://$(docker-machine ip swarm-keystore):8500" \
--engine-opt="cluster-advertise=eth1:2376" \
swarm-agent-n2
eval $(docker-machine env --swarm swarm-master)
docker info
echo "Run: eval \$(docker-machine env --swarm swarm-master)"