fix(docker): unignore target/release jars so release.yml + local builds work#64
Merged
Merged
Conversation
The .dockerignore added in #59 (foundation PR) excluded target/ and release/ wholesale to keep the build context lean. That broke both build paths the Dockerfile supports: - Local: `docker build .` -> Dockerfile expects target/netcopy.jar but .dockerignore excludes target/. - CI: release.yml stages release/netcopy-<version>.jar and passes it as JAR_FILE; .dockerignore excludes release/. The v0.4.0 release workflow (commit 500ce4f) failed at the docker build-push step with: ERROR: failed to compute cache key: "/release/netcopy-0.4.0.jar": not found Fix: keep the wholesale exclusions (build artefacts are big) but unignore specifically `target/netcopy.jar` and `release/*.jar`. Other build cruft (classes/, generated-sources/, surefire-reports/, ...) stays out of the image. This is a hotfix for v0.4.0 — once it merges, retag v0.4.0 onto the new HEAD so the release workflow re-runs and actually publishes the image and the jar to GitHub Releases. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Bug
The
.dockerignoreadded in #59 (foundation PR) excludedtarget/andrelease/wholesale to keep the build context lean. That broke both Docker build paths the project supports:docker build .→COPY target/netcopy.jarfails becausetarget/is excluded.release.ymlstagesrelease/netcopy-<version>.jarand passes it asJAR_FILE; the COPY fails becauserelease/is excluded.The v0.4.0 release workflow (commit
500ce4f) failed at the docker build-push step with:So
:0.4.0is NOT yet on GHCR and the GitHub Release page for v0.4.0 wasn't created (the workflow died before that step).Fix
Keep the wholesale exclusions (build artefacts are big and would bloat the image build context) but unignore specifically
target/netcopy.jarandrelease/*.jar:Other build cruft (
classes/,generated-sources/,surefire-reports/, …) still stays out of the image.Follow-up
Once this lands on
main, I'll delete and re-create thev0.4.0tag onto the fixed HEAD so the release workflow re-runs and actually publishes:ghcr.io/virusalex/netcopy:0.4.0(linux/amd64 + linux/arm64)netcopy-0.4.0.jarattached to the v0.4.0 GitHub ReleaseThis is safe because the failed v0.4.0 release didn't publish anything yet — no one has pulled it.
Test plan
🤖 Generated with Claude Code