From b5eaab277a9f817214fa7e4ede8d70e0a0752981 Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Wed, 3 May 2023 13:08:02 +0200 Subject: [PATCH] cicd(dockerfiles): update default user id and group id to match with chart's security context Issue: #110 --- bpdm-gate/Dockerfile | 8 ++++++-- bpdm-pool/Dockerfile | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bpdm-gate/Dockerfile b/bpdm-gate/Dockerfile index 953e7a015..fe3b6c23c 100644 --- a/bpdm-gate/Dockerfile +++ b/bpdm-gate/Dockerfile @@ -6,8 +6,12 @@ RUN mvn -B -U clean package -pl bpdm-gate -am -DskipTests FROM eclipse-temurin:17-jre-alpine COPY --from=build /home/app/bpdm-gate/target/bpdm-gate.jar /usr/local/lib/bpdm/app.jar RUN apk update && apk upgrade libssl3 libcrypto3 -RUN addgroup -S bpdm && adduser -S bpdm -G bpdm -USER bpdm +ARG USERNAME=bpdm +ARG USERID=10001 +ARG GID=3000 +RUN groupadd --gid $GID -S $USERNAME \ + && useradd --uid $USERID --gid $GID -m $USERNAME +USER $USERNAME WORKDIR /usr/local/lib/bpdm EXPOSE 8080 ENTRYPOINT ["java","-jar","app.jar"] \ No newline at end of file diff --git a/bpdm-pool/Dockerfile b/bpdm-pool/Dockerfile index 89b28a143..de9f2489c 100644 --- a/bpdm-pool/Dockerfile +++ b/bpdm-pool/Dockerfile @@ -6,8 +6,12 @@ RUN mvn -B -U clean package -pl bpdm-pool -am -DskipTests FROM eclipse-temurin:17-jre-alpine COPY --from=build /home/app/bpdm-pool/target/bpdm-pool.jar /usr/local/lib/bpdm/app.jar RUN apk update && apk upgrade libssl3 libcrypto3 -RUN addgroup -S bpdm && adduser -S bpdm -G bpdm -USER bpdm +ARG USERNAME=bpdm +ARG USERID=10001 +ARG GID=3000 +RUN groupadd --gid $GID -S $USERNAME \ + && useradd --uid $USERID --gid $GID -m $USERNAME +USER $USERNAME WORKDIR /usr/local/lib/bpdm EXPOSE 8080 ENTRYPOINT ["java","-jar","app.jar"] \ No newline at end of file