1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-11-29 17:23:22 +03:00
git-cliff/Dockerfile

31 lines
1020 B
Docker
Raw Normal View History

FROM lukemathwalker/cargo-chef:0.1.39-rust-1.63.0-slim-buster as planner
2021-06-11 21:41:03 +03:00
WORKDIR app
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM lukemathwalker/cargo-chef:0.1.39-rust-1.63.0-slim-buster as cacher
2021-06-11 21:41:03 +03:00
WORKDIR app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
--allow-unauthenticated git
2021-06-11 21:41:03 +03:00
COPY --from=planner /app/recipe.json recipe.json
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
2021-06-11 21:41:03 +03:00
RUN cargo chef cook --release --recipe-path recipe.json
FROM rust:1.63.0-slim-buster as builder
2021-06-11 21:41:03 +03:00
WORKDIR app
2021-06-11 22:50:16 +03:00
RUN apt-get update && \
apt-get install -y --no-install-recommends \
--allow-unauthenticated zlib1g-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2021-06-11 21:41:03 +03:00
COPY . .
COPY --from=cacher /app/target target
COPY --from=cacher $CARGO_HOME $CARGO_HOME
RUN cargo build --release --locked --no-default-features
2021-06-11 21:41:03 +03:00
RUN rm -f target/release/deps/git_cliff*
FROM debian:buster-slim as runner
WORKDIR app
COPY --from=builder /app/target/release/git-cliff /usr/local/bin
ENTRYPOINT ["git-cliff"]