-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
55 lines (47 loc) · 1.61 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
# -*- 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/redis:2.8 --no-cache=true 2.8
docker tag nanobox/redis:2.8 nanobox/redis:2.8
docker build -t nanobox/redis:3.0 --no-cache=true 3.0
docker tag nanobox/redis:3.0 nanobox/redis:3.0
docker build -t nanobox/redis:3.2 --no-cache=true 3.2
docker tag nanobox/redis:3.2 nanobox/redis:3.2
docker build -t nanobox/redis:4.0 --no-cache=true 4.0
docker tag nanobox/redis:4.0 nanobox/redis:4.0
SCRIPT
end