diff --git a/cmd/otelcontribcol/Dockerfile b/cmd/otelcontribcol/Dockerfile index 0ced1e9d5739..d4a9f14cbe1a 100644 --- a/cmd/otelcontribcol/Dockerfile +++ b/cmd/otelcontribcol/Dockerfile @@ -1,10 +1,3 @@ -FROM golang:1.20 AS build - -WORKDIR /src -ADD . /src - -RUN cd cmd/otelcontribcol && CGO_ENABLED=0 go build -o /otelcontribcol - FROM alpine:latest as prep RUN apk --update add ca-certificates @@ -15,8 +8,11 @@ FROM scratch ARG USER_UID=10001 USER ${USER_UID} +ARG TARGETOS +ARG TARGETARCH + COPY --from=prep /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=build /otelcontribcol /otelcontribcol +COPY ../../bin/otelcontribcol_${TARGETOS}_${TARGETARCH} /otelcontribcol EXPOSE 4317 55680 55679 ENTRYPOINT ["/otelcontribcol"] CMD ["--config", "/etc/otel/config.yaml"]