-
Notifications
You must be signed in to change notification settings - Fork 7
/
init_swarm_vbox.sh
executable file
·30 lines (23 loc) · 1.05 KB
/
init_swarm_vbox.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
#!/bin/bash
set -e
docker-machine create -d virtualbox manager
docker-machine create -d virtualbox worker1
docker-machine create -d virtualbox worker2
docker-machine create -d virtualbox worker3
docker $(docker-machine config manager) \
swarm init \
--listen-addr $(docker-machine ip manager):2377 \
--advertise-addr $(docker-machine ip manager):2377
docker $(docker-machine config worker1) \
swarm join $(docker-machine ip manager):2377 \
--listen-addr $(docker-machine ip worker1):2377 \
--token $(docker $(docker-machine config manager) swarm join-token worker -q)
docker $(docker-machine config worker2) \
swarm join $(docker-machine ip manager):2377 \
--listen-addr $(docker-machine ip worker2):2377 \
--token $(docker $(docker-machine config manager) swarm join-token worker -q)
docker $(docker-machine config worker3) \
swarm join $(docker-machine ip manager):2377 \
--listen-addr $(docker-machine ip worker3):2377 \
--token $(docker $(docker-machine config manager) swarm join-token worker -q)
docker $(docker-machine config manager) info