mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 21:42:34 +00:00
Fix Dockerfile for arm64 builds
Hopefully this works now
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user