-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile-qn
27 lines (23 loc) · 1.06 KB
/
Dockerfile-qn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17 AS build
COPY --chown=quarkus:quarkus mvnw /code/mvnw
COPY --chown=quarkus:quarkus .mvn /code/.mvn
COPY --chown=quarkus:quarkus pom.quarkus.xml /code/pom.xml
USER quarkus
WORKDIR /code
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
COPY src /code/src
COPY src/main/java/com/acmeair/mongo/MongoProducer.java.quarkus.native /code/src/main/java/com/acmeair/mongo/MongoProducer.java
RUN ./mvnw package -Pnative -Dmaven.test.skip
## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
COPY --from=build /code/target/*-runner /work/application
# set up permissions for user `1001`
RUN chmod 775 /work /work/application \
&& chown -R 1001 /work \
&& chmod -R "g+rwX" /work \
&& chown -R 1001:root /work
EXPOSE 9080
USER 1001
CMD ["./application", "-Dquarkus.http.host=0.0.0.0","-Dquarkus.http.port=9080","-Djava.util.logging.manager=org.jboss.logmanager.LogManager"]