forked from kubesail/pibox-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
66 lines (55 loc) · 1.9 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
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "4086"
end
config.vm.box = "generic/ubuntu2004"
config.vm.synced_folder "./", "/vagrant", disabled: false
config.vm.provision "shell", inline: <<-SHELL
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -yqq && sudo apt-get install -yqq bash curl pigz git net-tools software-properties-common
sudo apt-get install -yqq \
kpartx \
qemu-user-static \
git \
wget \
curl \
vim \
unzip \
gcc
# Download specific Go version
echo "Removing existing Go packages and installing Go"
[[ -e /tmp/go ]] && rm -rf /tmp/go*
sudo apt-get remove -yqq 'golang-*'
cd /tmp
wget -q https://go.dev/dl/go1.16.14.linux-amd64.tar.gz
tar xf go1.16.14.linux-amd64.tar.gz
cp -r go /usr/lib/go-1.16
rm -rf /tmp/go*
# Set GO paths for vagrant user
echo 'export GOROOT=/usr/lib/go-1.16
export GOPATH=$HOME/work
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' | tee -a /home/vagrant/.profile
# Also set them while we work:
export GOROOT=/usr/lib/go-1.16
export GOPATH=$HOME/work
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
PACKER_VERSION="1.7.10"
# Download and install packer
[[ -e /tmp/packer ]] && rm -rf /tmp/packer*
wget https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip \
-q -O /tmp/packer_${PACKER_VERSION}_linux_amd64.zip
cd /tmp
unzip -u packer_${PACKER_VERSION}_linux_amd64.zip
cp -v packer /usr/local/bin
rm -rf /tmp/packer*
cd ..
mkdir -p $GOPATH/src/github.com/solo-io/
cd $GOPATH/src/github.com/solo-io/
git clone https://github.com/solo-io/packer-plugin-arm-image
cd packer-plugin-arm-image
go mod download
go build
mv -v packer-plugin-arm-image /vagrant/
SHELL
end