From ef8d95b7da7c41c72abc670ffd19781d560316b2 Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Thu, 13 Aug 2026 14:59:21 -0400 Subject: [PATCH] fix(docker): use multi-stage build to install curl (quarkus-micro-image:2.0 ships no microdnf) The 2.0 rebuild of quarkus-micro-image removed microdnf to slim the image, so the inline 'microdnf install curl-minimal' step now fails with 'command not found'. Build curl-minimal in a ubi9/ubi-minimal builder stage, then copy only the curl binary + its runtime shared libs + CA bundle into the final quarkus-micro-image layer. Final image stays slim and the docker-compose healthcheck keeps working. --- Dockerfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd9c06b..f527aaf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,21 @@ +FROM registry.access.redhat.com/ubi9/ubi-minimal AS curl-builder +RUN microdnf install -y curl-minimal && microdnf clean all \ + && mkdir -p /out \ + && install -m 0755 /usr/bin/curl /out/usr/bin/curl \ + && for lib in $(ldd /usr/bin/curl | awk '/=>/ {print $3}' | sort -u); do \ + install -D -m 0755 "$lib" "/out$lib"; \ + done \ + && cp -rP /etc/pki/ca-trust /out/etc/pki/ \ + && cp -rP /etc/ssl /out/etc/ + FROM quay.io/quarkus/quarkus-micro-image:2.0 WORKDIR /work/ COPY build-output/shot-crafter-calculator-1.0.0-runner /work/application +COPY --from=curl-builder /out/ / -RUN microdnf install -y curl-minimal && microdnf clean all \ - && chmod 775 /work /work/application \ - && chown -R 1001 /work \ - && echo "securerandom.source=file:/dev/urandom" >> /work/application +RUN chmod 775 /work /work/application \ + && chown -R 1001 /work \ + && echo "securerandom.source=file:/dev/urandom" >> /work/application EXPOSE 8080 USER 1001