fix(docker): drop RUN commands - quarkus-micro-image:2.0 has no shell
CI / Build Native (push) Failing after 15m1s
CI / Build Native (push) Failing after 15m1s
Removed the RUN chmod/chown/echo steps from the Dockerfile. The Quarkus micro image 2.0 ships without /bin/sh and /usr/bin/sh, so any RUN instruction fails. The chmod and securerandom.source append now happen in the CI 'Stage binary for Docker' step, and COPY --chown=1001:1001 takes ownership of the binary in the image. COPY --chown requires BuildKit, so: - Install docker-buildx in the CI - Switch docker build -> docker buildx build The final image stays minimal (no shell, no microdnf, no extra packages).
This commit is contained in:
+1
-6
@@ -9,15 +9,10 @@ RUN microdnf install -y curl-minimal && microdnf clean all \
|
||||
&& cp -rP /etc/ssl /out/etc/
|
||||
|
||||
FROM quay.io/quarkus/quarkus-micro-image:2.0
|
||||
SHELL ["/usr/bin/sh", "-c"]
|
||||
WORKDIR /work/
|
||||
COPY build-output/shot-crafter-calculator-1.0.0-runner /work/application
|
||||
COPY --chown=1001:1001 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user