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

updates #110
  • Loading branch information
nicoprow committed May 4, 2023
1 parent f4be856 commit ea0f6bf
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 addgroup -g $GID -S $USERNAME
RUN adduser -u $USERID -S $USERNAME $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 addgroup -g $GID -S $USERNAME
RUN adduser -u $USERID -S $USERNAME $USERNAME
USER $USERNAME
WORKDIR /usr/local/lib/bpdm
EXPOSE 8080
ENTRYPOINT ["java","-jar","app.jar"]

0 comments on commit ea0f6bf

Please sign in to comment.