Skip to content

Commit 765b08a

Browse files
Vagrantfile updates.
1 parent a6e437c commit 765b08a

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

Vagrantfile

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,47 @@
1-
# -*- mode: ruby -*-
2-
# vi: set ft=ruby :
1+
# Specify minimum Vagrant version and Vagrant API version
2+
Vagrant.require_version ">= 1.6.0"
3+
VAGRANTFILE_API_VERSION = "2"
34

5+
# Create box
46
Vagrant.configure("2") do |config|
7+
config.vm.define "containerd-linux"
58
config.vm.box = "hashicorp/bionic64"
6-
79
config.vm.synced_folder ".", "/home/vagrant/go/src/nomad-driver-containerd"
8-
10+
config.ssh.extra_args = ["-t", "cd /home/vagrant/go/src/nomad-driver-containerd; bash --login"]
911
config.vm.network "forwarded_port", guest: 4646, host: 4646, host_ip: "127.0.0.1"
10-
12+
config.vm.provider "virtualbox" do |vb|
13+
vb.name = "containerd-linux"
14+
vb.cpus = 2
15+
vb.memory = 2048
16+
end
1117
config.vm.provision "shell", inline: <<-SHELL
1218
apt-get update
1319
apt-get install -y unzip gcc runc
14-
if [ ! -f "/usr/local/bin/go" ]; then
15-
# Install golang 1.14.3
20+
echo "export GOPATH=/home/vagrant/go" >> /home/vagrant/.bashrc
21+
echo "export PATH=$PATH:/usr/local/go/bin" >> /home/vagrant/.bashrc
22+
source /home/vagrant/.bashrc
23+
24+
# Install golang-1.14.3
25+
if [ ! -f "/usr/local/go/bin/go" ]; then
1626
curl -s -L -o go1.14.3.linux-amd64.tar.gz https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
1727
sudo tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
1828
sudo chmod +x /usr/local/go
19-
sudo cp /usr/local/go/bin/go /usr/local/bin/go
2029
rm -f go1.14.3.linux-amd64.tar.gz
2130
fi
31+
32+
# Install nomad-0.11.3
2233
if [ ! -f "/usr/bin/nomad" ]; then
2334
wget --quiet https://releases.hashicorp.com/nomad/0.11.3/nomad_0.11.3_linux_amd64.zip
24-
unzip nomad_0.11.3_linux_amd64.zip
25-
chmod +x nomad
26-
cp nomad /usr/bin/nomad
35+
unzip nomad_0.11.3_linux_amd64.zip -d /usr/bin
36+
chmod +x /usr/bin/nomad
37+
rm -f nomad_0.11.3_linux_amd64.zip
38+
fi
39+
40+
# Install containerd-1.3.4
41+
if [ ! -f "/usr/local/bin/containerd" ]; then
42+
curl -L --silent -o containerd-1.3.4.linux-amd64.tar.gz https://github.com/containerd/containerd/releases/download/v1.3.4/containerd-1.3.4.linux-amd64.tar.gz
43+
tar -C /usr/local -xzf containerd-1.3.4.linux-amd64.tar.gz
44+
rm -f containerd-1.3.4.linux-amd64.tar.gz
2745
fi
2846
SHELL
2947
end
File renamed without changes.

0 commit comments

Comments
 (0)