forked from orhun/git-cliff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (24 loc) · 908 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
FROM lukemathwalker/cargo-chef:0.1.35-rust-1.60-slim-buster as planner
WORKDIR app
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM lukemathwalker/cargo-chef:0.1.35-rust-1.60-slim-buster as cacher
WORKDIR app
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
FROM rust:1.60.0-slim-buster as builder
WORKDIR app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
--allow-unauthenticated zlib1g-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY . .
COPY --from=cacher /app/target target
COPY --from=cacher $CARGO_HOME $CARGO_HOME
RUN cargo build --release --locked --no-default-features
RUN rm -f target/release/deps/git_cliff*
RUN strip target/release/git-cliff
FROM debian:buster-slim as runner
WORKDIR app
COPY --from=builder /app/target/release/git-cliff /usr/local/bin
ENTRYPOINT ["git-cliff"]