forked from hlgr360/docker-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
70 lines (53 loc) · 1.95 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
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.6.3"
$vb_memory = 1024
$vb_cpus = 1
# See https://vagrantcloud.com/yungsang/boxes/boot2docker
# See http://blog.zenika.com/index.php?post/2014/10/07/Setting-up-a-development-environment-using-Docker-and-Vagrant
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "boot2docker"
config.vm.box = "yungsang/boot2docker"
config.vm.provider :virtualbox do |vb|
vb.memory = $vb_memory
vb.cpus = $vb_cpus
end
config.vm.synced_folder ".", "/app"
# Or you can use NFS as before
# config.vm.network "private_network", ip: "192.168.33.10"
# config.vm.synced_folder ".", "/app", type: "nfs"
# Uncomment below to use more than one instance at once
#config.vm.network :forwarded_port, guest: 2375, host: 2375, auto_correct: true
# Fix busybox/udhcpc issue
config.vm.provision :shell do |s|
s.inline = <<-EOT
if ! grep -qs ^nameserver /etc/resolv.conf; then
sudo /sbin/udhcpc
fi
cat /etc/resolv.conf
EOT
end
# Adjust datetime after suspend and resume
config.vm.provision :shell do |s|
s.inline = <<-EOT
sudo /usr/local/bin/ntpclient -s -h pool.ntp.org
date
EOT
end
# config.vm.provision :docker do |d|
# d.pull_images "yungsang/busybox"
# d.run "simple-echo",
# image: "yungsang/busybox",
# args: "-p 8080:8080",
# cmd: "nc -p 8080 -l -l -e echo hello world!"
# end
# [ngircd] Port Forwarding (only SSL)
config.vm.network "forwarded_port", guest: 6697, host: 6697
# [kiwiirc] Port Forwarding (only SSL)
config.vm.network "forwarded_port", guest: 7778, host: 7778
# [rails][telescope] Port Forwarding
config.vm.network "forwarded_port", guest: 3000, host: 3000
# [swagger-editor, swagger-ui] Port Forwarding
config.vm.network "forwarded_port", guest: 8080, host: 8080
# [phppgadmin][kanboard] Port Forwarding
config.vm.network "forwarded_port", guest: 80, host: 3001
end