I'm running ubuntu 20.04. If you're not, its up to you to figure it out :)
On a freshly installed Ubuntu 20.04 system:
cat << EOF >> ~/.bashrc
export VISUAL=vim
export EDITOR="$VISUAL"
export PATH=$PATH:~/go/bin
set -o vi
EOF
sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot
And after a reboot, install build tooling:
sudo snap install go --classic
# Install/configure docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -a -G docker $USER
# exit and relog in to get a session with your user in the docker group
sudo curl -L \
"https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo apt-get install -y make
docker buildx create --use
# Install linuxkit v0.8
mkdir -p ~/go/{src,pkg,bin}
go get -u golang.org/x/lint/golint
go get -u github.com/gordonklaus/ineffassign
mkdir -p ~/go/src/github.com/linuxkit
cd ~/go/src/github.com/linuxkit
git clone https://github.com/linuxkit/linuxkit.git
cd linuxkit
git checkout v0.8
make
cp bin/linuxkit ~/go/bin/linuxkit
# for hook & sandbox
mkdir -p ~/go/src/github.com/tinkerbell/
cd ~/go/src/github.com/tinkerbell/
git clone https://github.com/tinkerbell/sandbox.git
git clone https://github.com/tinkerbell/hook.git
## Hook
# We don't need to push images
sed -i 's,--push,--output=local,g' hook/Makefile
# make linuxkit happy, don't pull images every time
sed -i 's,-disable-content-trust -pull,,g' hook/Makefile
# Enable intel ethernet controller https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/intel/Kconfig#L331
sed -i 's,# CONFIG_IGC is not set,CONFIG_IGC=m,g' ./hook/kernel/config-*
# Seems to hang forever, set a timeout?
timeout 120 make -C hook/kernel -j 16 kconfig_amd64 KCONFIG_TAG=hack
# takes ~60m with 32GB/4core i3
make -C hook/kernel -j 16 devbuild_5.10.x
# !!! IMPORTANT !!!
# Now edit your `Makefile` with the diff I included above
# Now edit your `hook.yaml` similar to mine above
# Takes ~2min with 32GB/4core i3
# linuxkit seems to copy the `.ssh/authorized_keys` and not rewrite the gid/uid even if set in hook.yaml
# The only way I could figure out to get the file ownership correct was to `make dist` as root
sudo make -C hook dist
# We don't want to download OSIE later, so we set TB_OSIE_TAR to the build output
export TB_OSIE_TAR=$HOME/go/src/github.com/tinkerbell/hook/hook-$(git -C hook log -1 --format="%h")-dirty.tar.gz
## Sandbox
cd sandbox
sed -i 's,dl-cdn,dl-2,g' deploy/tls/Dockerfile
sed -i 's,setup_networking ,#setup_networking ,g' setup.sh
# replace enp88s0 with your primary interface name
generate-env.sh enp88s0 > .env
# replace "10.1.1.11" with your primary interface address
sed -i 's/192.168.1.1/10.1.1.11/g' .env
# replace "24" with your primary interface network cidr
sed -i 's/TINKERBELL_CIDR=29/TINKERBELL_CIDR=24/g' .env
source .env
# Run setup
# This should use your hook tarball you set as TB_OSIE_TAR above instead of downloading OSIE.
# After subsequient tweaks to `hook.yaml`, you can re-run `make dist` in the hook directory
# and untar that tarball into ~/go/src/github.com/tinkerbell/sandbox/deploy/state/webroot/misc/osie/current
./setup.sh
# Setup the tink server
cd deploy
docker-compose up -d
docker-compose ps
# install tink-cli
go get github.com/tinkerbell/tink/cmd/tink-cli
cp ~/go/bin/tink-cli ~/go/bin/tink
export TINKERBELL_GRPC_AUTHORITY=127.0.0.1:42113
export TINKERBELL_CERT_URL=http://127.0.0.1:42114/cert
Now you can follow the Vagrant guide where you set the Worker Wardware data. You can use tink
instead of the tink-cli in the docker container