Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
ci: Upgrade project to use Java 17
Browse files Browse the repository at this point in the history
- Update base docker image from openjdk:11-jdk-slim and openjdk:11-jre-slim to eclipse-temurin:17-jdk-alpine and eclipse-temurin:17-jre-alpine after deprecation notice. More info at docker-library/openjdk#505
- Update shell command to create user/group in Dockerfile after base image change
  • Loading branch information
lealceldeiro committed Jul 13, 2022
1 parent 590318f commit fa4925b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# general ref: https://docs.spring.io/spring-boot/docs/2.6.4/reference/htmlsingle/#container-images
FROM openjdk:11-jdk-slim as BUILD_STAGE
FROM eclipse-temurin:17-jdk-alpine as BUILD_STAGE

ARG app_jar_name="org.wcdevs.blog-rest"

Expand All @@ -24,7 +24,7 @@ RUN ./mvnw -B clean package
# ref: http://www.gnu.org/software/coreutils/mkdir
RUN mkdir -p dependencies && (cd dependencies; jar -xf ../rest/target/${app_jar_name}.jar)

FROM openjdk:11-jre-slim as RUN_STAGE
FROM eclipse-temurin:17-jre-alpine as RUN_STAGE
LABEL author="Asiel Leal Celdeiro"

ARG app_port=8080
Expand All @@ -36,9 +36,9 @@ EXPOSE ${management_port}
RUN mkdir -p "/wcd_app"

# ref: https://spring.io/guides/gs/spring-boot-docker/
RUN adduser --system --group wcdevs
RUN chown -R wcdevs /wcd_app
USER wcdevs:wcdevs
RUN addgroup -S wcdevs && adduser -S wcdevsuser -G wcdevs
RUN chown -R wcdevsuser /wcd_app
USER wcdevsuser

COPY --from=BUILD_STAGE /workspace/dependencies/BOOT-INF/lib /wcd_app/lib
COPY --from=BUILD_STAGE /workspace/dependencies/META-INF /wcd_app/META-INF
Expand Down

0 comments on commit fa4925b

Please sign in to comment.