From d06711010377d382e4416b3b0c16d67c3970afb7 Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Wed, 12 Aug 2026 19:44:14 -0400 Subject: [PATCH] fix(ci): stage native binary in build-output/ to bypass .dockerignore The .dockerignore has 'target' which excludes the target/ directory from the docker build context. The Dockerfile was COPYing the binary from target/, so docker build failed with 'file not found in build context or excluded by .dockerignore'. Fix: copy the binary to build-output/ (a non-excluded path) before docker build, and update the Dockerfile to copy from build-output/. - Add 'Stage binary for Docker' step that does: mkdir -p build-output cp target/shot-crafter-calculator-1.0.0-runner build-output/ - Dockerfile COPY now reads build-output/shot-crafter-calculator-1.0.0-runner - build-output/ is not in .dockerignore -> only the binary (~117MB) ships in the build context, not the whole target/ tree (~200MB with classes, generated-sources, node binaries, etc.) --- .gitea/workflows/ci.yml | 5 +++++ Dockerfile | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4f4e3f5..8525dec 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -66,6 +66,11 @@ jobs: run: | ls -la target/shot-crafter-calculator-1.0.0-runner + - name: Stage binary for Docker + run: | + mkdir -p build-output + cp target/shot-crafter-calculator-1.0.0-runner build-output/ + - name: Build & Push Docker image if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | diff --git a/Dockerfile b/Dockerfile index 52204bb..cd6fd2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM quay.io/quarkus/quarkus-micro-image:2.0 WORKDIR /work/ -COPY target/shot-crafter-calculator-1.0.0-runner /work/application +COPY build-output/shot-crafter-calculator-1.0.0-runner /work/application RUN chmod 775 /work /work/application \ && chown -R 1001 /work \