↗ Building Linux eBPF/XDP Applications on macOS with Colima, Docker, Clang, and Go
· 17 min read

eBPF and XDP are increasingly used for network traffic filtering, observability, abuse protection, and performing extremely cheap packet inspections before traffic reaches the regular Linux networking stack.
There is one practical problem, though: if your primary workstation is a Mac — especially an Apple Silicon Mac — you cannot build and test Linux eBPF programs exactly the same way you build a normal Go application.
For a reproducible build environment, we need:
- Go
- Clang and LLVM
- Linux headers
- libbpf headers
bpf2go- Docker
- a Linux runtime provided by Colima
