-
Notifications
You must be signed in to change notification settings - Fork 25
/
Vagrantfile
39 lines (34 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
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.box_version = "20220902.0.0"
config.vm.disk :disk, size: "20GB"
config.vm.synced_folder "../", "/home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf", create: true
config.ssh.extra_args = ["-t", "cd /home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf; bash --login"]
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
# install dependencies
config.vm.provision "shell", inline: <<-SHELL
cd /home/vagrant/go/src/github.com/mozillazg/cloud-native-security-with-ebpf
sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
apt-get update
apt-get update
apt-get install --yes build-essential pkgconf zlib1g-dev libelf-dev libzstd-dev llvm-12 clang-12 \
linux-tools-common linux-tools-generic linux-tools-$(uname -r)
for tool in "clang" "llc" "llvm-strip"
do
path=$(which $tool-12)
ln -s -f $path ${path%-*}
done
snap install go --channel=1.21/stable --classic
chown vagrant -R /home/vagrant/go/
grep GOPROXY /home/vagrant/.bashrc || \
echo 'export GOPROXY=https://goproxy.cn,direct' >> /home/vagrant/.bashrc
tail -n 2 /home/vagrant/.bashrc | grep PS1 || \
echo 'PS1="$PS1\\n"' >> /home/vagrant/.bashrc
tail -n 2 /root/.bashrc | grep PS1 || \
echo 'PS1="$PS1\\n"' >> /root/.bashrc
SHELL
end