Skip to content

Commit

Permalink
Set unprivileged user to container image (#6380)
Browse files Browse the repository at this point in the history
ARG was reset after FROM, causing docker running on root.
  • Loading branch information
pjachowi authored Nov 18, 2021
1 parent e4c1fa0 commit 55fee2d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/otelcontribcol/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM alpine:latest as prep
RUN apk --update add ca-certificates

ARG USER_UID=10001

RUN mkdir -p /tmp

FROM scratch

ARG USER_UID=10001
USER ${USER_UID}

COPY --from=prep /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
Expand Down

0 comments on commit 55fee2d

Please sign in to comment.