From f2e260f55d247392cc0186dc8363a39d5a9cefc5 Mon Sep 17 00:00:00 2001 From: denerFernandes <837495+denerFernandes@users.noreply.github.com> Date: Thu, 14 May 2026 20:41:27 +0200 Subject: [PATCH] fix(docker): touch src/main.rs to force recompilation in cache layer The dependency-cache layer removes the binary and fingerprints, but cargo's incremental detection still considers the crate up-to-date when the real sources are COPYed in the next layer. This resulted in a 580KB dummy binary (from the 'fn main(){}' stub) being shipped instead of the real 15MB proxy binary. Adding 'touch src/main.rs' before the final cargo build forces cargo to recompile the turbineproxy crate. --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10de1e2..9a1e105 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,8 +50,11 @@ RUN RUST_TARGET="$(cat /rust_target)" \ # ── Full source build ── COPY src ./src COPY benches ./benches -RUN CARGO_INCREMENTAL=0 cargo build --release \ - --target "$(cat /rust_target)" +# Touch main.rs to force cargo to re-link (the dep-cache step removes the +# binary and fingerprints, but cargo sometimes still skips recompilation). +RUN touch src/main.rs \ + && CARGO_INCREMENTAL=0 cargo build --release \ + --target "$(cat /rust_target)" # ── Copy binary to a fixed path so the runtime stage doesn't need TARGETARCH ── RUN cp "target/$(cat /rust_target)/release/turbineproxy" /turbineproxy