diff --git a/Dockerfile b/Dockerfile index 4f9361a..8ff9816 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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