fix(docker): add libzstd-dev for static validator link + lean image as default build target#43
Merged
Merged
Conversation
…age the default build target Two Dockerfile bugs broke the containerized install: 1. The validator-builder stage statically links the validator (-lbpf -lelf -lzstd -lz) but libzstd-dev was missing from its apt packages, so `docker build --target with-validator` failed with `/usr/bin/ld: cannot find -lzstd`. Static libbpf/libelf pull in zstd. 2. with-validator was the last stage, so a plain `docker build .` built the fat validator+clang+llvm image instead of the documented lean, binary-only image. Reordered so the lean `final` stage is last and is the real default target. Verified: `docker build .` and `docker build --target with-validator` both build and run `bpfcompat version`; the validator image carries a working bpfcompat-validator. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two
Dockerfilebugs broke the containerized install path, both fixed here.1.
docker build --target with-validatorfailed:cannot find -lzstdThe
validator-builderstage statically links the in-guest validator (-lbpf -lelf -lzstd -lz), butlibzstd-devwas missing from its apt packages. Static libbpf/libelf pull in zstd, so the link failed:Added
libzstd-devto the builder.2. Plain
docker build .built the wrong (fat) imagewith-validatorwas the last stage, so a no---targetbuild resolved to the fat validator+clang+llvm image — contradicting the documenteddocker build -t bpfcompat:dev .→ lean binary-only image. Reordered so the leanfinalstage is last and is the real default.Verification
docker build .→ lean image builds, runsbpfcompat versiondocker build --target with-validator→ builds, runsbpfcompat version, and bundles a workingbpfcompat-validatorat/usr/libexec/bpfcompat/go build ./...,go vet ./...,go test ./...all green (no Go changes)🤖 Generated with Claude Code