lizrice / learning-ebpf

Learning eBPF, published by O'Reilly - out now! Here's where you'll find a VM config for the examples, and more

Home Page:https://www.amazon.com/Learning-eBPF-Programming-Observability-Networking/dp/1098135121

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Helpful Instructions That Work For Docker

laikas123 opened this issue · comments

Assuming you have docker installed the following should work to get you up and running for an environment that will work for this book:

Getting the image and running it:

sudo docker image pull ubuntu:22.10
sudo docker run -ti --privileged ubuntu:22.10 /bin/bash

You should now have a root shell in the new docker image.

Then to get it setup run all of the following:

(can run as .sh script, probably wanna use apt-get install nano to get a text editor)

apt-get update
apt-get install -y apt-transport-https ca-certificates curl clang llvm jq
apt-get install -y libelf-dev libpcap-dev libbfd-dev binutils-dev build-essential make
apt-get install -y linux-tools-common linux-tools-5.15.0-41-generic bpfcc-tools
apt-get install -y python3-pip
apt-get install -y git
git clone --recurse-submodules https://github.com/lizrice/learning-ebpf
cd learning-ebpf
cd libbpf/src
make install
cd ../..
cd ..
git clone --recurse-submodules https://github.com/libbpf/bpftool.git
cd bpftool/src
make install

You are good to go.