ef8d95b7da
CI / Build Native (push) Failing after 14m50s
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.
24 lines
765 B
Docker
24 lines
765 B
Docker
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 chmod 775 /work /work/application \
|
|
&& chown -R 1001 /work \
|
|
&& echo "securerandom.source=file:/dev/urandom" >> /work/application
|
|
|
|
EXPOSE 8080
|
|
USER 1001
|
|
|
|
ENTRYPOINT ["./application"]
|