-
Notifications
You must be signed in to change notification settings - Fork 387
/
Vagrantfile
73 lines (44 loc) · 1.86 KB
/
Vagrantfile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Vagrant.require_version ">= 1.7.4"
# change default synced_folder for convenience
SYNCED_FOLDER = "/home/vagrant/docker-workshop"
# expose ports from guest to host for convenience
FORWARDED_PORT_RANGE = (10080..10100).to_a.push(10443).to_a.push(8080)
# external provision script files
PROVISION_SCRIPTS = [ "provision/setup-docker-tools.sh", "provision/setup-env.sh", "provision/setup-hosts.sh" ]
Vagrant.configure(2) do |config|
config.vm.define "main", primary: true do |node|
node.vm.box = "williamyeh/ubuntu-trusty64-docker"
node.vm.box_version = ">= 1.8.1"
node.vm.network "private_network", ip: "10.0.0.10"
for i in FORWARDED_PORT_RANGE
node.vm.network "forwarded_port", guest: i, host: i
end
node.vm.synced_folder ".", SYNCED_FOLDER
for f in PROVISION_SCRIPTS
node.vm.provision "shell", path: f
end
node.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
#vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end
config.vm.define "centos" do |node|
node.vm.box = "bento/centos-5.11"
node.vm.network "private_network", ip: "10.0.0.30"
node.vm.synced_folder ".", SYNCED_FOLDER
# [NOTE] unmark this while benchmarking VM startup time
#node.vm.box_check_update = false
node.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "256"]
end
end
config.vm.define "registry" do |node|
node.vm.box = "williamyeh/docker-workshop-registry"
node.vm.box_version = ">= 5.0.0"
node.vm.network "private_network", ip: "10.0.0.200"
node.vm.synced_folder ".", SYNCED_FOLDER
for f in PROVISION_SCRIPTS
node.vm.provision "shell", path: f
end
end
end