Correct improper dummy file being built and served.
This commit is contained in:
parent
ed31642cd3
commit
86b878cd60
1 changed files with 3 additions and 5 deletions
|
|
@ -56,11 +56,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
||||||
|
|
||||||
# Now copy the real source and build the final binary
|
# Now copy the real source and build the final binary
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
# Only remove the dummy main.rs if it exists and is not the real one
|
# Remove dummy main.rs if present, then build the real binary in one step to avoid cache issues
|
||||||
RUN if grep -q 'cargo cache build' src/main.rs 2>/dev/null; then rm src/main.rs; fi
|
RUN if grep -q 'cargo cache build' src/main.rs 2>/dev/null; then rm src/main.rs; fi \
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
|
&& cargo build --release --locked
|
||||||
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
|
|
||||||
cargo build --release
|
|
||||||
|
|
||||||
# --- Stage 2: Final, small image ---
|
# --- Stage 2: Final, small image ---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue