-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
32 lines (28 loc) · 1.13 KB
/
Dockerfile.dev
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
FROM golang:1.23-bookworm AS runj
WORKDIR /usr/src/app/
COPY runj/go.mod runj/go.sum ./
RUN go mod download && go mod verify
COPY runj/ ./
RUN make build
FROM lukemathwalker/cargo-chef:latest-rust-1.82-slim-bookworm AS chef
RUN apt update -qq && \
DEBIAN_FRONTEND=noninteractive apt install -qqy --no-install-recommends pkg-config libdbus-1-dev libsystemd-dev protobuf-compiler libssl-dev patch
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --recipe-path recipe.json
COPY . .
RUN cargo build --bin seele
FROM bitnami/minideb:bookworm AS runtime
WORKDIR /etc/seele
RUN install_packages ca-certificates curl gpg gpg-agent umoci uidmap pkg-config libdbus-1-dev libsystemd-dev protobuf-compiler libssl-dev skopeo
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-amd64 /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
COPY --from=runj /usr/src/app/bin/runj /usr/local/bin
COPY --from=builder /app/target/debug/seele /usr/local/bin
CMD ["/usr/local/bin/seele"]