Skip to content

Commit

Permalink
cicd(dockerfiles): update default user id and group id to match with …
Browse files Browse the repository at this point in the history
…chart's security context

Issue: #110
  • Loading branch information
nicoprow committed May 3, 2023
1 parent f4be856 commit b5eaab2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions bpdm-gate/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 6 additions & 2 deletions bpdm-pool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit b5eaab2

Please sign in to comment.