Fix Dockerfile for arm64 builds

Hopefully this works now
This commit is contained in:
Lennart
2025-01-21 16:03:44 +01:00
parent e169ba0c58
commit 483ded96d5

View File

@@ -3,6 +3,10 @@ FROM --platform=$BUILDPLATFORM rust:1.84-alpine AS chef
ARG TARGETPLATFORM
ARG BUILDPLATFORM
# the compiler will otherwise ask for aarch64-linux-musl-gcc
ENV CC_aarch64_unknown_linux_musl=gcc
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"
# Stupid workaound with tempfiles since environment variables
# from RUN commands don't persist across stages
RUN case $TARGETPLATFORM in \
@@ -31,7 +35,7 @@ COPY --from=planner /rustical/recipe.json recipe.json
RUN cargo chef cook --release --target "$(cat /tmp/rust_target)"
COPY . .
RUN --mount=type=cache,target=target cargo install --target $TARGET --path .
RUN --mount=type=cache,target=target cargo install --target "$(cat /tmp/rust_target)" --path .
FROM scratch
COPY --from=builder /usr/local/cargo/bin/rustical /usr/local/bin/rustical