From 1db571b60785e27796a5561692406e6cc48920c7 Mon Sep 17 00:00:00 2001 From: VirusAlex Date: Fri, 1 May 2026 10:34:57 +0300 Subject: [PATCH] fix(docker): unignore the staged jar so release.yml + local builds work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-.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) --- .dockerignore | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index c7e4a17..be8ce88 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,9 +4,17 @@ # (worse) can leak in-progress secrets or unfinished work into intermediate # image layers. -# Build outputs +# Build outputs. +# +# We DO need the staged jar to enter the build context — the Dockerfile +# either COPYs `target/netcopy.jar` (local `docker build .`) or +# `release/netcopy-.jar` (CI release.yml). The unignore patterns +# below let exactly those jars through while still keeping intermediate +# build artefacts (classes, generated sources, surefire reports, …) out. target/ +!target/netcopy.jar release/ +!release/*.jar # Git history (we COPY only the staged jar / entrypoint into the image) .git/