Skip to content

Commit

Permalink
feat: use chmod flag during COPY (open-telemetry#212)
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yblanc@edgelab.ch>

Signed-off-by: Yoan Blanc <yblanc@edgelab.ch>
  • Loading branch information
greut authored Oct 18, 2022
1 parent 556b9cd commit 08b1607
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions distributions/otelcol-contrib/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
FROM alpine:3.16 as certs
RUN apk --update add ca-certificates

FROM alpine:3.16 AS otelcol-contrib
COPY otelcol-contrib /otelcol-contrib
# 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-contrib

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-contrib /otelcol-contrib /
COPY --chmod=755 otelcol-contrib /otelcol-contrib
COPY configs/otelcol-contrib.yaml /etc/otelcol-contrib/config.yaml
ENTRYPOINT ["/otelcol-contrib"]
CMD ["--config", "/etc/otelcol-contrib/config.yaml"]
Expand Down
8 changes: 1 addition & 7 deletions distributions/otelcol/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
FROM alpine:3.16 as certs
RUN apk --update add ca-certificates

FROM alpine:3.16 AS otelcol
COPY otelcol /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 --chmod=755 otelcol /otelcol
COPY configs/otelcol.yaml /etc/otelcol/config.yaml
ENTRYPOINT ["/otelcol"]
CMD ["--config", "/etc/otelcol/config.yaml"]
Expand Down

0 comments on commit 08b1607

Please sign in to comment.