File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Changed
11+ - Docker dependency cache now survives version-only bumps by normalizing the root package version in a preparatory build stage.
12+
1013## [ 1.3.0] - 2026-03-12
1114
1215### Added
Original file line number Diff line number Diff line change 1+ # Normalize root package version so the dependency cache survives version-only bumps.
2+ # BuildKit uses content-based caching for COPY --from; the sed output is identical
3+ # when only the version changed, so the expensive cargo build layer stays cached.
4+ FROM rust:1.88-alpine AS deps
5+ WORKDIR /src
6+ COPY Cargo.toml Cargo.lock ./
7+ RUN sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.toml && \
8+ sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.lock
9+
110FROM rust:1.88-alpine AS builder
211ARG VERSION=dev
312RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static perl
413WORKDIR /src
5- COPY Cargo.toml Cargo.lock ./
14+ COPY --from=deps /src/ Cargo.toml /src/ Cargo.lock ./
615RUN mkdir src && echo 'fn main() {}' > src/main.rs && \
716 cargo build --release && \
817 rm -rf src target/release/deps/initium* target/release/initium*
Original file line number Diff line number Diff line change 1+ # Normalize root package version so the dependency cache survives version-only bumps.
2+ # BuildKit uses content-based caching for COPY --from; the sed output is identical
3+ # when only the version changed, so the expensive cargo build layer stays cached.
4+ FROM rust:1.88-alpine AS deps
5+ WORKDIR /src
6+ COPY Cargo.toml Cargo.lock ./
7+ RUN sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.toml && \
8+ sed -i '/^name = "initium"/{n;s/^version = ".*"/version = "0.0.0"/;}' Cargo.lock
9+
110FROM rust:1.88-alpine AS builder
211ARG VERSION=dev
312RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static perl
413WORKDIR /src
5- COPY Cargo.toml Cargo.lock ./
14+ COPY --from=deps /src/ Cargo.toml /src/ Cargo.lock ./
615RUN mkdir src && echo 'fn main() {}' > src/main.rs && \
716 cargo build --release && \
817 rm -rf src target/release/deps/initium* target/release/initium*
You can’t perform that action at this time.
0 commit comments