forked from apocas/dockerode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
42 lines (33 loc) · 1.19 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "ubuntu/trusty64"
BOX_URI = ENV['BOX_URI'] || "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
SSH_PRIVKEY_PATH = ENV["SSH_PRIVKEY_PATH"]
$script = <<SCRIPT
user="$1"
if [ -z "$user" ]; then
user=vagrant
fi
wget -q -O - https://get.docker.io/gpg | apt-key add -
echo 'deb http://get.docker.io/ubuntu docker main' > \
/etc/apt/sources.list.d/docker.list
add-apt-repository ppa:chris-lea/node.js
apt-get update -q
apt-get install -q -y lxc-docker python-software-properties python g++ make software-properties-common nodejs
usermod -a -G docker "$user"
SCRIPT
Vagrant::Config.run do |config|
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
if SSH_PRIVKEY_PATH
config.ssh.private_key_path = SSH_PRIVKEY_PATH
end
config.ssh.forward_agent = true
end
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb, override|
override.vm.provision :shell, :inline => $script
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
end