-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (26 loc) · 1.19 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (26 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM rust:1-bookworm AS build
# protoc for silo-proto's build.rs.
RUN apt-get update \
&& apt-get install -y --no-install-recommends protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . .
RUN cargo build --release -p silo-server -p silo-cli
FROM debian:bookworm-slim
# ca-certificates is the only runtime dependency: outbound TLS to S3 and to
# the OIDC issuer. All three index formats — repodata, APKINDEX, packuments
# — are generated in-process, so there is no package tooling to install.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build --chmod=755 /build/target/release/silo-server /usr/local/bin/silo-server
# The CLI ships in the same image so `kubectl exec` can manage tokens and
# users without a second image or a local install.
COPY --from=build --chmod=755 /build/target/release/silo /usr/local/bin/silo
# Runs unprivileged, and with nothing to write to: index generation is
# entirely in-memory, and everything durable lives in object storage and
# Postgres.
RUN useradd --system --uid 10001 --create-home silo
USER 10001
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/silo-server"]