-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (36 loc) · 1.23 KB
/
Dockerfile
File metadata and controls
50 lines (36 loc) · 1.23 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
46
47
48
49
50
################
##### Builder
FROM rust:1.94.1-slim-trixie AS base
RUN cargo install --locked cargo-chef
WORKDIR app
################
##### Plan
FROM base AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
################
##### Build
FROM base AS builder
#RUN rustup target add x86_64-unknown-linux-gnu &&\
RUN apt update &&\
apt install -y openssl libssl-dev libssl3 pkg-config \
protobuf-compiler &&\
update-ca-certificates
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# Copy the actual sources
COPY . .
# This is the actual application build.
RUN cargo build --release --bins
################
##### Runtime
FROM debian:trixie-slim AS runtime
LABEL maintainer="Artem Goncharov"
#RUN apk add --no-cache bash openssl ca-certificates
RUN apt update && apt install -y ca-certificates libssl3 && update-ca-certificates
# Copy application binary from builder image
COPY --from=builder /app/target/release/keystone /usr/local/bin
COPY --from=builder /app/target/release/keystone-db /usr/local/bin
COPY --from=builder /app/target/release/keystone-manage /usr/local/bin
CMD ["/usr/local/bin/keystone"]