| 1 | # `cilium/ebpf` LLVM Builder Image |
| 2 | |
| 3 | This is a simple Docker image to provide reproducible eBPF ELF builds across |
| 4 | contributors' workstations. This standardizes on a single environment used to |
| 5 | regenerate e.g. testdata ELFs and does not depend on the toolchain installed |
| 6 | on the host machine. |
| 7 | |
| 8 | Additionally, it reduces drift in the bytecode committed to the repository over |
| 9 | time as the same exact clang + llc version is used throughout the development |
| 10 | lifecycle. Only when upgrading or rebuilding the Docker image would changes in |
| 11 | .elf files be expected (assuming the .c files are untouched). |
| 12 | |
| 13 | ## Building |
| 14 | |
| 15 | Building the image requires Docker. Run the build with: |
| 16 | |
| 17 | `make build` |
| 18 | |
| 19 | This updates the `VERSION` file. Commit it and submit a PR upstream. |
| 20 | |
| 21 | ### Regeneration Testdata on non-x86 platforms |
| 22 | |
| 23 | Before running `make`, ensure [Docker buildx](https://docs.docker.com/buildx/working-with-buildx/) |
| 24 | is enabled. Additionally `QEMU user` and `binfmt` should be installed. On a Debian based distribution |
| 25 | the command to add them is `apt install qemu-user-static binfmt-support`. |
| 26 | |
| 27 | |
| 28 | ## Pushing |
| 29 | |
| 30 | After building, push the image to the Docker registry specified in `IMAGE` with: |
| 31 | |
| 32 | `make push` |