From 8975e30d1063c2a62716c737c1388089d1542682 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 16 Jan 2025 19:24:44 +0000 Subject: [PATCH] build: build release image using alpine linux --- Dockerfile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf9c55f..e8ef1de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ # cargo-chef and the Rust toolchain FROM git.kemitix.net/kemitix/rust:v4.0.1 AS chef WORKDIR /app +RUN apk add --no-cache dbus-dev=1.14.10-r4 && rm -rf /vra/cache/apk/* FROM chef AS planner COPY Cargo.toml ./ @@ -12,19 +13,13 @@ FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json RUN cargo chef cook --profile release --recipe-path recipe.json COPY . . -RUN cargo build --release --bin git-next --all-features && \ - strip target/release/git-next +RUN cargo build --release --bin git-next --all-features && strip target/release/git-next -FROM docker.io/debian:stable-20241223-slim AS runtime +FROM chef AS runtime 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 COPY --from=builder /app/target/release/git-next /usr/local/bin ENV HOME=/app - ENTRYPOINT [ "/usr/local/bin/git-next" ] CMD [ "server", "start" ]