Skip to content

Commit

Permalink
Creating and using non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
tendestad committed May 28, 2024
1 parent 6476410 commit 2034a4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM gcr.io/distroless/java21-debian12

RUN groupadd -r --gid 1069 apprunner && useradd -r --uid 1069 -g apprunner apprunner

WORKDIR /app

COPY build/libs/app-*.jar app.jar
Expand All @@ -11,4 +13,8 @@ ENV DISABLE_PDF_GET="true"
ENV ENABLE_HTML_ENDPOINT="false"

EXPOSE 8080

RUN chown -R apprunner /app
USER apprunner

CMD [ "app.jar" ]

0 comments on commit 2034a4b

Please sign in to comment.