1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-10-05 19:27:27 +03:00
git-cliff/Dockerfile

27 lines
725 B
Docker
Raw Normal View History

# syntax=docker/dockerfile:1.4.3-labs
FROM lukemathwalker/cargo-chef:0.1.59-rust-1.69-buster AS chef
2021-06-11 21:41:03 +03:00
WORKDIR app
FROM chef AS planner
2021-06-11 21:41:03 +03:00
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
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
COPY . .
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
COPY --from=builder /app/target/release/git-cliff /usr/local/bin
WORKDIR git-home
RUN cat <<'EOF' > entrypoint.sh
#!/bin/sh
cp -r /app /git-home/app
cd /git-home/app
exec git-cliff "$@"
EOF
ENTRYPOINT ["sh", "entrypoint.sh"]