From 950e602293c8094f909f667a8364cc91abcbf52c Mon Sep 17 00:00:00 2001 From: Luiz Henrique Pegoraro Date: Tue, 30 Jan 2024 10:56:02 -0300 Subject: [PATCH] chore: fix build, now it is only failing due to missing imports. --- Makefile | 4 ++-- cmd/otelcol-orb-agent/Dockerfile | 19 ++++++++++++------- cmd/otelcol-orb-agent/builder-config.yaml | 2 +- cmd/otelcol-orb-maestro/Dockerfile | 19 +++++++++++++------ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index b7ae6fe..a01aa54 100644 --- a/Makefile +++ b/Makefile @@ -205,11 +205,11 @@ endif .PHONY: docker-otelcolagent docker-otelcolagent: - cd cmd/otelcol-orb-agent && docker build -t otelcol-orb-agent:develop . + docker build -t otelcol-orb-agent:develop -f cmd/otelcol-orb-agent/Dockerfile . .PHONY: docker-otelcolmaestro docker-otelcolmaestro: - cd cmd/otelcol-orb-maestro && docker build -t otelcol-orb-maestro:develop . + docker build -t otelcol-orb-maestro:develop -f cmd/otelcol-orb-maestro/Dockerfile . .PHONY: generate generate: install-tools diff --git a/cmd/otelcol-orb-agent/Dockerfile b/cmd/otelcol-orb-agent/Dockerfile index 2386bb7..4132f5c 100644 --- a/cmd/otelcol-orb-agent/Dockerfile +++ b/cmd/otelcol-orb-agent/Dockerfile @@ -1,13 +1,19 @@ -FROM golang:1.21-alpine as builder +FROM golang:1.21.6-alpine as builder RUN apk --update add ca-certificates git tzdata +RUN go install go.opentelemetry.io/collector/cmd/builder@latest -WORKDIR /build +WORKDIR /go/src/github.com/orbcommunity/otelcol-orb -COPY ../../receiver /build/receivers +COPY go.mod . + +RUN go mod tidy + +COPY . . + +COPY cmd/otelcol-orb-agent/builder-config.yaml . +COPY cmd/otelcol-orb-agent/example-config.yaml . -RUN go install go.opentelemetry.io/collector/cmd/builder@latest -COPY builder-config.yaml . RUN builder --config=builder-config.yaml @@ -20,8 +26,7 @@ USER ${USER_UID} COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /tmp/otelcol/otelcol-orb /otelcol-orb -COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo -COPY example-config.yaml /etc/otel/config.yaml +COPY --from=builder /tmp/otelcol/example-config.yaml /etc/otel/config.yaml EXPOSE 4317 55680 55679 13133 ENTRYPOINT ["/otelcol-orb"] CMD ["--config", "/etc/otel/config.yaml"] \ No newline at end of file diff --git a/cmd/otelcol-orb-agent/builder-config.yaml b/cmd/otelcol-orb-agent/builder-config.yaml index c56a9e9..d93dd7e 100644 --- a/cmd/otelcol-orb-agent/builder-config.yaml +++ b/cmd/otelcol-orb-agent/builder-config.yaml @@ -113,4 +113,4 @@ extensions: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.93.0 replaces: - - github.com/orb-community/otelcol-orb/receiver/httpmetricsreceiver => ../../../receiver/httpmetricsreceiver + - github.com/orb-community/otelcol-orb/receiver/httpmetricsreceiver => ./../receiver/httpmetricsreceiver diff --git a/cmd/otelcol-orb-maestro/Dockerfile b/cmd/otelcol-orb-maestro/Dockerfile index c4a8d67..9cbd770 100644 --- a/cmd/otelcol-orb-maestro/Dockerfile +++ b/cmd/otelcol-orb-maestro/Dockerfile @@ -1,11 +1,19 @@ -FROM golang:1.21-alpine as builder +FROM golang:1.21.6-alpine as builder RUN apk --update add ca-certificates git tzdata +RUN go install go.opentelemetry.io/collector/cmd/builder@latest -WORKDIR /build +WORKDIR /go/src/github.com/orbcommunity/otelcol-orb + +COPY go.mod . + +RUN go mod tidy + +COPY . . + +COPY cmd/otelcol-orb-maestro/builder-config.yaml . +COPY cmd/otelcol-orb-maestro/example-config.yaml . -RUN go install go.opentelemetry.io/collector/cmd/builder@latest -COPY builder-config.yaml . RUN builder --config=builder-config.yaml @@ -18,8 +26,7 @@ USER ${USER_UID} COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /tmp/otelcol/otelcol-orb /otelcol-orb -COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo -COPY example-config.yaml /config.yaml +COPY --from=builder /tmp/otelcol/example-config.yaml /etc/otel/config.yaml EXPOSE 4317 55680 55679 13133 ENTRYPOINT ["/otelcol-orb"] CMD ["--config", "/etc/otel/config.yaml"] \ No newline at end of file