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
https://www.amazon.com/Learning-eBPF-Programming-Observability-Networking/dp/1098135121
Apache License 2.0
1.19k stars 255 forks source link

Helpful Instructions That Work For Docker #14

Open laikas123 opened 1 year ago

laikas123 commented 1 year ago

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.