~james/core

core/knot2/Containerfile -rw-r--r-- 1.1 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM docker.io/library/rust:1.96-slim-trixie AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
      ca-certificates build-essential cmake perl pkg-config clang mold \
    && rm -rf /var/lib/apt/lists/*
ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold"
WORKDIR /src
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
COPY crates ./crates
COPY bobbin/crates ./bobbin/crates
COPY shuttle ./shuttle
COPY knotmirror/crates ./knotmirror/crates
COPY lexicons ./lexicons
COPY knot2/crates ./knot2/crates
COPY knot2/third_party ./knot2/third_party
RUN cargo build --release --package knot-server --package knot-migrate
RUN strip target/release/knot-server target/release/knot-migrate

FROM gcr.io/distroless/cc-debian13:latest@sha256:d74d144baa124dd9defd01d71872bb56c49d4441dba6153ccf790364f97e64b1
COPY --from=builder /src/target/release/knot-server /usr/local/bin/knot-server
COPY --from=builder /src/target/release/knot-migrate /usr/local/bin/knot-migrate
EXPOSE 5555 2222
ENTRYPOINT ["/usr/local/bin/knot-server"]
CMD ["--config", "/etc/knot/config.toml"]