FROM amd64/rust:1.64.0-bullseye as build-env RUN apt update && apt upgrade -y RUN apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross RUN rustup target add aarch64-unknown-linux-gnu RUN rustup toolchain install stable-aarch64-unknown-linux-gnu WORKDIR /app COPY . . ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \ CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ RUN cargo build --release --target aarch64-unknown-linux-gnu --features=cli,umbrel FROM --platform=linux/arm64 gcr.io/distroless/cc COPY --from=build-env /app/target/aarch64-unknown-linux-gnu/release/app-cli / CMD ["/app-cli"]