build: build release image using alpine linux
This commit is contained in:
parent
be9993029e
commit
8975e30d10
1 changed files with 3 additions and 8 deletions
11
Dockerfile
11
Dockerfile
|
@ -2,6 +2,7 @@
|
||||||
# cargo-chef and the Rust toolchain
|
# cargo-chef and the Rust toolchain
|
||||||
FROM git.kemitix.net/kemitix/rust:v4.0.1 AS chef
|
FROM git.kemitix.net/kemitix/rust:v4.0.1 AS chef
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apk add --no-cache dbus-dev=1.14.10-r4 && rm -rf /vra/cache/apk/*
|
||||||
|
|
||||||
FROM chef AS planner
|
FROM chef AS planner
|
||||||
COPY Cargo.toml ./
|
COPY Cargo.toml ./
|
||||||
|
@ -12,19 +13,13 @@ FROM chef AS builder
|
||||||
COPY --from=planner /app/recipe.json recipe.json
|
COPY --from=planner /app/recipe.json recipe.json
|
||||||
RUN cargo chef cook --profile release --recipe-path recipe.json
|
RUN cargo chef cook --profile release --recipe-path recipe.json
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN cargo build --release --bin git-next --all-features && \
|
RUN cargo build --release --bin git-next --all-features && strip target/release/git-next
|
||||||
strip target/release/git-next
|
|
||||||
|
|
||||||
FROM docker.io/debian:stable-20241223-slim AS runtime
|
FROM chef AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get satisfy -y "git (>=2.39), libssl3 (>=3.0.14), libdbus-1-dev (>=1.14.10), ca-certificates (>=20230311)" \
|
|
||||||
&& \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
USER 1000
|
USER 1000
|
||||||
COPY --from=builder /app/target/release/git-next /usr/local/bin
|
COPY --from=builder /app/target/release/git-next /usr/local/bin
|
||||||
|
|
||||||
ENV HOME=/app
|
ENV HOME=/app
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/local/bin/git-next" ]
|
ENTRYPOINT [ "/usr/local/bin/git-next" ]
|
||||||
CMD [ "server", "start" ]
|
CMD [ "server", "start" ]
|
||||||
|
|
Loading…
Add table
Reference in a new issue