Docker image: uses distroless base

Allows to reduce the image size from 102MB to 42MB
speedb
Tpt 2 years ago committed by Thomas Tanon
parent 13976014e7
commit 76dec0b6a8
  1. 13
      server/Dockerfile

@ -1,20 +1,11 @@
FROM rust:1-bullseye as builder FROM rust:1-bullseye as builder
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y libclang-dev clang apt-get install -y libclang-dev clang
COPY . /oxigraph COPY . /oxigraph
WORKDIR /oxigraph/server WORKDIR /oxigraph/server
RUN cargo build --release RUN cargo build --release
FROM gcr.io/distroless/cc-debian11
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /oxigraph/target/release/oxigraph_server /usr/local/bin/oxigraph_server COPY --from=builder /oxigraph/target/release/oxigraph_server /usr/local/bin/oxigraph_server
ENTRYPOINT [ "/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" ]

Loading…
Cancel
Save