gitdataai/docker/git-hook.Dockerfile
ZhenYi 09dda115b4
Some checks reported errors
continuous-integration/drone/push Build encountered an error
fix(docker): remove BuildKit mount options for compatibility
2026-04-15 00:28:38 +08:00

33 lines
826 B
Docker

# ---- Stage 1: Build ----
FROM rust:1.94-bookworm AS builder
ARG BUILD_TARGET=x86_64-unknown-linux-gnu
ENV TARGET=${BUILD_TARGET}
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config libssl-dev libgit2-dev zlib1g-dev libclang-dev \
gcc g++ make \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY libs/ libs/
COPY apps/ apps/
RUN cargo fetch
RUN cargo build --release --package git-hook --target ${TARGET}
# ---- Stage 2: Runtime ----
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libssl3 openssh-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /build/target/${TARGET}/release/git-hook /app/git-hook
ENV APP_LOG_LEVEL=info
ENTRYPOINT ["/app/git-hook"]