Skip to content

fix(docker): unignore target/release jars so release.yml + local builds work#64

Merged
VirusAlex merged 1 commit into
mainfrom
fix/dockerignore-release-jars
May 1, 2026
Merged

fix(docker): unignore target/release jars so release.yml + local builds work#64
VirusAlex merged 1 commit into
mainfrom
fix/dockerignore-release-jars

Conversation

@VirusAlex
Copy link
Copy Markdown
Owner

Bug

The .dockerignore added in #59 (foundation PR) excluded target/ and release/ wholesale to keep the build context lean. That broke both Docker build paths the project supports:

  • Local: docker build .COPY target/netcopy.jar fails because target/ is excluded.
  • CI: release.yml stages release/netcopy-<version>.jar and passes it as JAR_FILE; the COPY fails because release/ is excluded.

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

So :0.4.0 is 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.jar and release/*.jar:

target/
!target/netcopy.jar
release/
!release/*.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 the v0.4.0 tag 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.jar attached to the v0.4.0 GitHub Release

This is safe because the failed v0.4.0 release didn't publish anything yet — no one has pulled it.

Test plan

  • CI green (this PR is single-line .dockerignore; nothing in unit-test land changes).
  • After merge + retag: release workflow goes green, image is pullable, jar is downloadable.

🤖 Generated with Claude Code

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]>
@VirusAlex VirusAlex merged commit d2f20a1 into main May 1, 2026
1 check passed
@VirusAlex VirusAlex deleted the fix/dockerignore-release-jars branch May 1, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants