Fix: Reply; Add: Docker build

This commit is contained in:
2025-06-02 23:30:52 +08:00
parent 1bcae2baba
commit 51ba0cbaed
3 changed files with 9 additions and 3 deletions
+6 -1
View File
@@ -5,10 +5,15 @@ WORKDIR /usr/src/app
ENV RUSTFLAGS="-C target-feature=+crt-static"
COPY Cargo.toml Cargo.lock ./
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
rustup target add x86_64-unknown-linux-musl \
&& cargo fetch --locked --target x86_64-unknown-linux-musl
COPY src ./src
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
rustup target add x86_64-unknown-linux-musl && cargo build --release --target x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
FROM alpine:latest
RUN apk add --no-cache libgcc