build(docker): don't include Cargo.lock in image

This commit is contained in:
Paul Campbell 2024-04-07 17:28:54 +01:00
parent ac37e9e199
commit edf551b72a

View file

@ -3,7 +3,7 @@
FROM git.kemitix.net/kemitix/git-next-builder:latest AS builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY Cargo.toml ./
COPY src src
RUN cargo chef prepare --recipe-path recipe.json
@ -11,7 +11,7 @@ ARG CARGO_PROFILE
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --profile "$CARGO_PROFILE" --recipe-path recipe.json
# Build application
COPY Cargo.toml Cargo.lock ./
COPY Cargo.toml ./
COPY src src
ARG CARGO_PROFILE
RUN cargo build --profile "$CARGO_PROFILE" --bin git-next