fix: replace --mount=type=cache with dependency layer caching#34
Merged
mikkeldamsgaard merged 1 commit intomainfrom Mar 11, 2026
Merged
fix: replace --mount=type=cache with dependency layer caching#34mikkeldamsgaard merged 1 commit intomainfrom
mikkeldamsgaard merged 1 commit intomainfrom
Conversation
…erfiles --mount=type=cache does not persist across GitHub Actions runners, causing full recompilation on every release build. Reintroduce the "empty main" trick for reliable Docker layer caching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s container build process to use Docker layer caching (via the “empty main.rs” dependency-build pattern) instead of BuildKit --mount=type=cache, improving cache reuse across GitHub Actions runners. It also documents the change in the changelog.
Changes:
- Replaced
--mount=type=cacheusage with a dependency-layer caching approach in both Docker build variants. - Adjusted final-stage binary copy paths to pull directly from
target/release/initium. - Added a changelog entry under [Unreleased] describing the Docker caching fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Dockerfile | Switches to dependency-layer caching to speed up repeat builds in CI and updates final binary copy path. |
| jyq.Dockerfile | Applies the same caching strategy for the jq/yq Alpine variant and updates final binary copy path. |
| CHANGELOG.md | Documents the Docker build caching change under the Unreleased “Fixed” section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--mount=type=cachewith the "empty main" dependency layer caching trick in bothDockerfileandjyq.Dockerfile--mount=type=cachedoes not persist across GitHub Actions runners, causing full Rust recompilation on every release buildtype=ghacacheTest plan
docker build -t initium .docker build -f jyq.Dockerfile -t initium-jyq .🤖 Generated with Claude Code