docker: make local builds work without version arg#9135
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the root Dockerfile to make docker build . succeed in local environments (notably Apple Silicon) without requiring release-only build arguments, by ensuring a non-empty VERSION and limiting parallelism by default.
Changes:
- Set a non-empty default for Docker build arg
VERSION(master) to avoid overriding Makefile version derivation with an empty value. - Add
MAKE_JOBSbuild arg (default1) and use it formake -j...in the builder stage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ARG VERSION=master | ||
| ARG MAKE_JOBS=1 | ||
| ENV VERSION=${VERSION} |
|
|
||
| RUN ./configure --prefix=/tmp/lightning_install --enable-static --disable-compat --disable-valgrind | ||
| RUN uv run make install-program -j$(nproc) | ||
| RUN uv run make install-program -j${MAKE_JOBS} |
1f900c1 to
ae9add8
Compare
|
Updated after initial submission: Re-verified after the update:
|
|
Updated to address the Dockerfile review feedback. The builder no longer sets a global default VERSION/ENV; when VERSION is omitted, the Makefile derives the version from git, and VERSION is only passed into make when explicitly provided. MAKE_JOBS remains optional and falls back to nproc when omitted.\n\nRe-verified after this update:\n- docker build --target builder --progress=plain .\n- docker build --progress=plain .\n\nI used a temporary Docker config for the local build because this machine's Docker config references a missing docker-credential-desktop helper; the image build itself completed on the colima builder. |
Fixes #7812
This makes the Dockerfile work for a plain local
docker build .on Apple Silicon without requiring release-only build args.Changes:
VERSIONbuild arg a non-empty default (master) soENV VERSIONdoes not override Makefile version generation with an empty valueMAKE_JOBSbuild arg while preserving the existing defaultnprocparallelism; low-memory local Docker VMs can pass--build-arg MAKE_JOBS=1Verified on macOS Apple Silicon with Colima (
linux/arm64target, 8GB/4 CPU):docker build --target builder --progress=plain .docker build --progress=plain .The original
configuratorfailure no longer occurs on current master, but a plain Docker build currently fails later because emptyVERSIONpreventsversion_gen.hgeneration. With this patch the full default Docker image builds successfully.