Skip to content

Commit

Permalink
Using ubi-minimal and generating licenses dir
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 12, 2024
1 parent 1513170 commit ab6d99c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/main/docker/Dockerfile.multistage
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
## Stage 1 : build with maven builder image
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build
FROM registry.redhat.io/quarkus/mandrel-for-jdk-21-rhel8:23.1 AS build
ARG MAVEN_BUILD_EXTRA_ARGS=
RUN echo "$MAVEN_BUILD_EXTRA_ARGS"
COPY --chown=quarkus:quarkus mvnw /code/mvnw
COPY --chown=quarkus:quarkus .mvn /code/.mvn
COPY --chown=quarkus:quarkus pom.xml /code/
USER quarkus
WORKDIR /code
RUN ./mvnw -B -ntp org.apache.maven.plugins:maven-dependency-plugin:3.6.1:go-offline
RUN ./mvnw -B -ntp org.apache.maven.plugins:maven-dependency-plugin:3.7.1:go-offline
RUN ./mvnw -B -ntp license:download-licenses
COPY src /code/src
RUN ./mvnw -ntp package -Pnative -DskipTests $MAVEN_BUILD_EXTRA_ARGS

## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-micro-image:2.0
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work

COPY --from=build --chown=1001 /code/target/*-runner /work/application

COPY --from=build --chown=101 /code/target/generated-resources/licenses /licenses
EXPOSE 8080
USER 1001

Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# docker run -i --rm -p 8080:8080 quarkus/registry-app
#
###
FROM quay.io/quarkus/quarkus-micro-image:2.0
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
Expand Down

0 comments on commit ab6d99c

Please sign in to comment.