forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set unprivileged user to container image (open-telemetry#2838)
* Set unprivileged user to container image Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> * Set alpine version to 3.13 Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
- Loading branch information
1 parent
aa04e81
commit 4e0f358
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
FROM alpine:3.12 as certs | ||
FROM alpine:3.13 as certs | ||
RUN apk --update add ca-certificates | ||
|
||
FROM alpine:3.12 AS otelcol | ||
FROM alpine:3.13 AS otelcol | ||
COPY otelcol / | ||
# Note that this shouldn't be necessary, but in some cases the file seems to be | ||
# copied with the execute bit lost (see #1317) | ||
RUN chmod 755 /otelcol | ||
|
||
FROM scratch | ||
|
||
ARG USER_UID=10001 | ||
USER ${USER_UID} | ||
|
||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=otelcol /otelcol / | ||
COPY config.yaml /etc/otel/config.yaml | ||
ENTRYPOINT ["/otelcol"] | ||
CMD ["--config", "/etc/otel/config.yaml"] | ||
EXPOSE 55678 55679 | ||
EXPOSE 4317 55678 55679 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters