-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathVagrantfile
62 lines (54 loc) · 1.98 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/impish64"
config.vm.synced_folder ".", "/opt/go/src/github.com/mrtc0/bouheki"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y \
wget \
curl \
build-essential \
libbpf-dev \
clang \
gcc-multilib \
llvm \
zlib1g-dev \
libelf-dev \
linux-tools-generic \
linux-tools-common \
linux-headers-$(uname -r) \
linux-tools-$(uname -r) \
ca-certificates \
gnupg \
lsb-release \
gotestsum
# Setup Golang
wget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz -O /tmp/go1.17.5.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.17.5.linux-amd64.tar.gz && ln -sf /usr/local/go/bin/go /usr/bin/go
echo "PATH=\$PATH:/usr/local/go/bin" > /etc/profile
mkdir -p /opt/go/{bin,src}
echo "GOROOT=/opt/go" >> /etc/profile
# Enable BPF LSM
sed -i 's/GRUB_CMDLINE_LINUX=\"\"$/GRUB_CMDLINE_LINUX=\"lsm=lockdown,yama,apparmor,bpf\"/' /etc/default/grub
update-grub
# Install Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
# Setup IPv6
cat <<EOF >/etc/docker/daemon.json
{
"ipv6": true,
"fixed-cidr-v6": "fc00:deed:beef::/24"
}
EOF
systemctl restart docker
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
SHELL
end