From fbb7c9a9ad8d03d5d095ac441a58b37537e0ab8d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 6 May 2026 09:35:55 +0300 Subject: add Dockerfile and Rocky Linux 9 build docs Introduces a Docker-based build path so ior can be compiled on any Linux host without a native Rocky 9 toolchain setup: - Dockerfile: Rocky 9 minimal image with Go (version from ARG, default from go.mod), static libelf/libzstd built from source, libbpfgo at v0.9.2-libbpf-1.5.1, and mage; CMD runs mage generate + mage all against the repo root mounted as a volume. - scripts/build-with-docker.sh: reads GO_VERSION from go.mod, passes it as --build-arg to docker build, mounts tracefs and BTF into the container, writes the binary to the repo root. - Magefile.go: adds BuildDocker target that wraps the script. - README.md: simplified to the two build paths (Docker + native) with links to docs/; removed GOTOOLCHAIN=auto throughout. - docs/build-rocky-linux-9.md: full manual Rocky 9 steps, libbpfgo toolchain setup/rollback, compile-once-run-everywhere explanation, and timing semantics. - docs/tui-reference.md: complete TUI hotkey reference, recording mode details, and the .ior.zst vs Parquet trade-off table. - AGENTS.md: removed GOTOOLCHAIN=auto from all build commands. - internal/c/generated_tracepoints.c: regenerated against the host kernel. Co-Authored-By: Claude Sonnet 4.6 --- Magefile.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Magefile.go') diff --git a/Magefile.go b/Magefile.go index cf1adfb..e9458b5 100644 --- a/Magefile.go +++ b/Magefile.go @@ -40,6 +40,7 @@ const ( tracepointsResultNew = "internal/c/generated_tracepoints_result.txt.new" tracepointsGoPath = "internal/tracepoints/generated_tracepoints.go" typesGoPath = "internal/types/generated_types.go" + dockerBuildScript = "scripts/build-with-docker.sh" typesHeaderPath = "internal/c/types.h" VMLINUXPath = "internal/c/vmlinux.h" benchProfilesDir = "bench-profiles" @@ -72,6 +73,16 @@ func All() error { return nil } +// BuildDocker builds the ior binary inside a Rocky Linux 9 Docker container +// and writes the resulting static binary to the repo root. The container +// image is built on the first run (~15-20 min) and reused thereafter. +// The Go version baked into the image is taken from go.mod automatically. +// Requires Docker and a host kernel with tracefs and BTF enabled. +// Pass --run to skip the image rebuild and only recompile ior. +func BuildDocker() error { + return sh.RunV("bash", dockerBuildScript) +} + // BpfBuild builds the embedded BPF object used by the Go binary. func BpfBuild() error { if err := ensureVMLINUX(); err != nil { -- cgit v1.2.3