Dockerfiles use non-root user (#1497)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2023-12-04 10:52:19 +02:00
committed by GitHub
parent 855124eca8
commit 341e8a4a0c
4 changed files with 16 additions and 0 deletions

View File

@@ -20,6 +20,10 @@ RUN set -x &&\
FROM eclipse-temurin:${JAVA_VERSION}-jre-alpine
RUN addgroup -S hawkbit_group && adduser -D hawkbit -G hawkbit_group
RUN mkdir -p /artifactrepo && chown -R hawkbit /artifactrepo
USER hawkbit
ENV BUILD_DIR=/opt/hawkbit_build
COPY --from=build ${BUILD_DIR}/dependencies/ ./
COPY --from=build ${BUILD_DIR}/spring-boot-loader/ ./