Created
February 17, 2024 14:37
-
-
Save franzwong/bfab6f02ca6ddb29fb37bfba263d6bf9 to your computer and use it in GitHub Desktop.
Multistage docker build of Quarkus native with GraalVM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ghcr.io/graalvm/native-image-community:21 as build | |
WORKDIR /workspace/app | |
COPY .mvn .mvn | |
COPY mvnw . | |
COPY pom.xml . | |
COPY src src | |
RUN ./mvnw install -Dnative | |
VOLUME /root/.m2 | |
# glibc version must match the one used in the builder image | |
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3 | |
WORKDIR /work/ | |
RUN chown 1001 /work \ | |
&& chmod "g+rwX" /work \ | |
&& chown 1001:root /work | |
COPY --from=build --chown=1001:root /workspace/app/target/*-runner /work/application | |
EXPOSE 8080 | |
USER 1001 | |
ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment