Alternative methods

Some other ways to run bpftool in your environment

Dockerfile

The GitHub mirror repository for bpftool contains a Dockerfile for building bpftool inside of a Docker container.

From the root of the repository, build the image with the following command:

$ docker build -t bpftool:latest .

Once the image is available, you can run it just like any other Docker container. Note that many bpftool commands require the container to run with extended privileges. The default entrypoint is a call to the bpftool binary. Here is an example invocation:

$ docker run --privileged bpftool:latest prog list

GitHub Action

Mahé maintains a GitHub Action to set up (and cache) a bpftool binary and use as part of a GitHub Workflow. See the project’s description for usage information.

Last modified December 5, 2023: installation: Add installation guides (e520c51)