Fetch the repository succeeded.
FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.80.1-bookworm AS chef
ARG BIN
WORKDIR /app
FROM chef AS planner
ARG BIN
COPY . .
RUN cargo chef prepare --recipe-path recipe.json --bin $BIN
FROM chef AS builder
ARG BIN
# Ensure working C compile setup (not installed by default in arm64 images)
RUN apt update && apt install build-essential cmake -y
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release --bin $BIN
FROM debian:bookworm-slim AS runtime
RUN apt-get update && \
apt-get install -y --no-install-recommends \
"ca-certificates" \
&& \
rm -rf /var/lib/apt/lists/*
ARG BIN
ENV BIN=$BIN
WORKDIR /app
USER nobody
COPY --from=builder /app/target/release/$BIN /usr/local/bin
ENTRYPOINT ["/bin/sh", "-c", "/usr/local/bin/$BIN"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。