Skip to content

Commit bebfda8

Browse files
committed
Add user to docker image to avoid running as root
1 parent 22c95d6 commit bebfda8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,9 @@ RUN CGO_ENABLED=0 go build \
3030
FROM alpine:3.17
3131
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
3232
COPY --from=builder /app/bin/kminion /app/kminion
33+
RUN addgroup -S redpanda \
34+
&& adduser -S redpanda -G redpanda \
35+
&& chmod o+rx /app/kminion
36+
USER redpanda
3337

3438
ENTRYPOINT ["/app/kminion"]

0 commit comments

Comments
 (0)