Skip to content

Commit

Permalink
change multistage dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaconsalvi committed Sep 9, 2024
1 parent 2d0604f commit 2138dde
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main/docker/Dockerfile.multistage
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,17 @@ USER quarkus
WORKDIR /code

RUN \
--mount=type=secret,id=gh_user,uid=1001 \
--mount=type=secret,id=gh_token,uid=1001 \
export GH_USER=$(cat /run/secrets/gh_user) && \
export GH_TOKEN=$(cat /run/secrets/gh_token) && \
echo "<settings><servers><server><id>github</id><username>$GH_USER</username><password>$GH_TOKEN</password></server><server><id>github-mil-azure-services</id><username>$GH_USER</username><password>$GH_TOKEN</password></server></servers></settings>" >> settings.xml

COPY src /code/src

RUN ./mvnw package -Pnative -Dmaven.test.skip=true -s settings.xml



RUN ./mvnw package -Dnative -Dmaven.test.skip=true -s settings.xml

## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-micro-image:2.0@sha256:ad4ebd25d024c6377d9497fb094a9acb22080f2b11396994e129f24e7d1b3b35

WORKDIR /work/

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

# set up permissions for user `1001`
Expand All @@ -40,7 +33,6 @@ RUN chmod 775 /work /work/application \
&& chown -R 1001:root /work

EXPOSE 8080

USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

0 comments on commit 2138dde

Please sign in to comment.