Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna2134 authored Feb 3, 2024
1 parent 9a9f0c4 commit 52eb225
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ RUN if [ $TARGETARCH = "amd64" ]; then \
RUN rustup target add $(cat /tmp/arch)-unknown-linux-musl

COPY . .
RUN --mount=type=cache,target=/src/builder/target/ echo "Compiling" \
if [ $(cat /tmp/arch) = "aarch64" ]; then
export CC_aarch64_unknown_linux_musl=clang
export AR_aarch64_unknown_linux_musl=llvm-ar
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"
else
echo "amd64 mode"
fi \
cargo build --target=$(cat /tmp/arch)-unknown-linux-musl --release
cp target/$(cat /tmp/arch)-unknown-linux-musl/release/expander /tmp/expander

FROM scratch
RUN --mount=type=cache,target=/src/builder/target/ bash build.sh

FROM alpine

WORKDIR /src/app

Expand Down

0 comments on commit 52eb225

Please sign in to comment.