From 76dec0b6a89d95a50059a856549901229d68f4fc Mon Sep 17 00:00:00 2001 From: Tpt Date: Mon, 27 Mar 2023 19:49:23 +0200 Subject: [PATCH] Docker image: uses distroless base Allows to reduce the image size from 102MB to 42MB --- server/Dockerfile | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index d7f2c20e..77d6bece 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,20 +1,11 @@ FROM rust:1-bullseye as builder - RUN apt-get update && \ apt-get install -y libclang-dev clang - COPY . /oxigraph WORKDIR /oxigraph/server RUN cargo build --release - -FROM debian:bullseye-slim - -RUN apt-get update && \ - apt-get install -y ca-certificates && \ - rm -rf /var/lib/apt/lists/* - +FROM gcr.io/distroless/cc-debian11 COPY --from=builder /oxigraph/target/release/oxigraph_server /usr/local/bin/oxigraph_server - ENTRYPOINT [ "/usr/local/bin/oxigraph_server" ] -CMD [ "--location", "/data", "serve", "--bind", "0.0.0.0:7878" ] +CMD [ "serve", "--location", "/data", "--bind", "0.0.0.0:7878" ]