diff --git a/server/Dockerfile b/server/Dockerfile index b40a5b4..9fbd0b7 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -6,6 +6,10 @@ # ---- stage 1: build -------------------------------------------------------------------------------------------- FROM docker.io/library/rust:1.99.1-bookworm AS build ARG TARGETARCH +# Parallel rustc jobs. Unset (the default) means cargo's own default, one per core, as on the Mac. The Gitea runner +# on the Pi 3 (1 GB RAM) passes --build-arg CARGO_BUILD_JOBS=1. Passed as an explicit --jobs flag, only when set, +# so an empty value never reaches cargo. +ARG CARGO_BUILD_JOBS # The full bookworm image carries gcc 12 and make, which aws-lc-sys (rustls via reqwest, jsonwebtoken) needs to # compile its C code; no cmake binary is needed (checked 2026-10-18, docs/spikes/pi-image-arm64.md). # Use the image's toolchain as is; rust-toolchain.toml names the same version but would also pull clippy/rustfmt. @@ -22,7 +26,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ amd64) triple=x86_64-unknown-linux-gnu ;; \ *) echo "unsupported TARGETARCH ${TARGETARCH}" >&2; exit 1 ;; \ esac \ - && cargo build --release --locked --target "$triple" -p kvitt-server -p kvitt-import \ + && echo "cargo build jobs: ${CARGO_BUILD_JOBS:-default (one per core)}" \ + && cargo build --release --locked --target "$triple" ${CARGO_BUILD_JOBS:+--jobs $CARGO_BUILD_JOBS} \ + -p kvitt-server -p kvitt-import \ && mkdir -p /out \ && cp "target/$triple/release/kvitt-server" "target/$triple/release/kvitt-import" /out/