Run the app in the container as a non-root user (#1575)

* Run as a non-root user. Fixes #1555

Signed-off-by: Roman Zabaluev <rzabaluev@provectus.com>

* Fix line break

Signed-off-by: Roman Zabaluev <rzabaluev@provectus.com>

Co-authored-by: Ruslan Ibragimov <94184844+5hin0bi@users.noreply.github.com>
This commit is contained in:
Roman Zabaluev 2022-02-09 17:59:22 +03:00 committed by GitHub
parent edabfca966
commit a040a66f09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,9 @@
FROM alpine:3.15.0
RUN apk add --no-cache openjdk13-jre libc6-compat gcompat
RUN apk add --no-cache openjdk13-jre libc6-compat gcompat \
&& addgroup -S kafkaui && adduser -S kafkaui -G kafkaui
USER kafkaui
ARG JAR_FILE
COPY "/target/${JAR_FILE}" "/kafka-ui-api.jar"