#!/bin/bash

echo $PWD

export WORKING_DIR=$PWD


sudo apt update
sudo apt install -y \
  git make golang-go go-md2man \
  libseccomp-dev libapparmor-dev \
  pkg-config uidmap \
  slirp4netns \
  libsystemd-dev \
  btrfs-progs libbtrfs-dev \
  libglib2.0-dev \
  libgpgme-dev \
  libdevmapper-dev \
  gcc g++ \
  jq curl wget


cd /tmp
wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
go version

cd $WORKING_DIR
make clean
make BUILDTAGS="seccomp apparmor systemd"

