build(docker): don't include Cargo.lock in image
Some checks failed
ci/woodpecker/push/docker Pipeline was successful
ci/woodpecker/push/todo-check Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/cron/release Pipeline was successful
ci/woodpecker/cron/docker Pipeline was successful
ci/woodpecker/cron/todo-check Pipeline was successful
ci/woodpecker/cron/build Pipeline failed

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