-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile
49 lines (41 loc) · 1.29 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", "2048", "--ioapic", "on"]
end
config.vm.synced_folder ".", "/vagrant"
# install docker
config.vm.provision "shell", inline: <<-SCRIPT
if [[ ! `which docker > /dev/null 2>&1` ]]; then
sudo apt-get -y purge docker-engine
bash <(curl -fsSL https://get.docker.com/)
# clean up packages that aren't needed
apt-get -y autoremove
# add the vagrant user to the docker group
usermod -aG docker vagrant
fi
SCRIPT
# start docker
config.vm.provision "shell", inline: <<-SCRIPT
if [[ ! `service docker status | grep "start/running"` ]]; then
# start the docker daemon
service docker start
fi
SCRIPT
# wait for docker to be running
config.vm.provision "shell", inline: <<-SCRIPT
echo "Waiting for docker sock file"
while [ ! -S /var/run/docker.sock ]; do
sleep 1
done
SCRIPT
# build the docker image
config.vm.provision "shell", inline: <<-SCRIPT
echo "Building docker image..."
cd /vagrant
docker build -t nanobox/unfs:0.9 --no-cache=true 0.9
docker tag -f nanobox/unfs:0.9 nanobox/unfs:0.9
SCRIPT
end