Improvements

This commit is contained in:
dobiadi
2024-10-14 20:21:19 +02:00
parent 13c01972f3
commit a78d71dd58
4 changed files with 121 additions and 54 deletions

View File

@@ -8,8 +8,17 @@ COPY src/ /usr/src/src/
WORKDIR /usr/src
RUN apk add --no-cache rustup build-base && \
rustup-init -qy --profile=minimal && \
rustup-init -qy --profile=minimal --default-toolchain=$RUST_VERSION && \
source "$HOME/.cargo/env" && \
mkdir src && echo "fn main() {}" > src/main.rs && \
cargo fetch && \
cargo build --release --target=x86_64-unknown-linux-musl && \
rm src/main.rs
COPY src/ /usr/src/src/
RUN source "$HOME/.cargo/env" && \
touch src/main.rs && \
cargo build --release --target=x86_64-unknown-linux-musl
FROM alpine:$ALPINE_VERSION