-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (33 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (33 loc) · 1.04 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM rust:1.96-slim-bookworm AS chef
RUN cargo install cargo-chef --locked
WORKDIR /build
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
ENV CARGO_TERM_COLOR=always
COPY --from=planner /build/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release --locked --bin kairo
FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
WORKDIR /app
COPY --from=builder --chown=nonroot:nonroot /build/target/release/kairo /app/kairo
ENV KAIRO_CONFIG=/app/application.yml \
RUST_LOG=info \
MIMALLOC_ARENA_EAGER_COMMIT=0
EXPOSE 2333
ENTRYPOINT ["/app/kairo"]
FROM gcr.io/distroless/cc-debian12:nonroot AS ci
WORKDIR /app
ARG TARGETARCH
COPY bin/linux/${TARGETARCH}/kairo /app/kairo
ENV KAIRO_CONFIG=/app/application.yml \
RUST_LOG=info \
MIMALLOC_ARENA_EAGER_COMMIT=0
EXPOSE 2333
ENTRYPOINT ["/app/kairo"]