diff --git a/distributions/otelcol-contrib/Dockerfile b/distributions/otelcol-contrib/Dockerfile index 532c3326..aeb90975 100644 --- a/distributions/otelcol-contrib/Dockerfile +++ b/distributions/otelcol-contrib/Dockerfile @@ -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"] diff --git a/distributions/otelcol/Dockerfile b/distributions/otelcol/Dockerfile index bf6220c1..c3160d83 100644 --- a/distributions/otelcol/Dockerfile +++ b/distributions/otelcol/Dockerfile @@ -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"]