forked from d-e-s-o/cargo-http-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (23 loc) · 883 Bytes
/
Dockerfile
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 lukemathwalker/cargo-chef:0.1.62-rust-bullseye AS chef
WORKDIR /app
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 pkg-config libssl-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release --bin cargo-http-registry
FROM debian:bullseye-slim as runner
WORKDIR /app
RUN apt-get update && \
apt-get install -y git && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN git config --global user.name = "cargo-http-registry"
RUN git config --global user.email = "[email protected]"
COPY --from=builder /app/target/release/cargo-http-registry /usr/local/bin
ENTRYPOINT ["cargo-http-registry"]