|
1 | 1 | ## base ############################################################################################# |
2 | | -FROM otel/opentelemetry-collector-contrib:0.147.0 AS col |
3 | | -FROM otel/opentelemetry-collector-opampsupervisor:0.147.0 AS supervisor |
| 2 | +ARG OTEL_COLLECTOR_VERSION=0.149.0 |
| 3 | +ARG OTEL_COLLECTOR_CORE_VERSION=1.55.0 |
| 4 | + |
| 5 | +FROM otel/opentelemetry-collector-opampsupervisor:${OTEL_COLLECTOR_VERSION} AS supervisor |
4 | 6 | FROM hairyhenderson/gomplate:v4.3.3-alpine AS gomplate |
5 | 7 | FROM kukymbr/goose-docker@sha256:0cd025636df126e7f66472861ca4db3683bc649be46cd1f6ef1a316209058e23 AS goose |
6 | 8 |
|
7 | | -# Build the Go migration tool with full TLS support for ClickHouse |
| 9 | +# Build the custom HyperDX collector binary using OCB (OpenTelemetry Collector Builder). |
| 10 | +# This replaces the pre-built otel/opentelemetry-collector-contrib image so we can |
| 11 | +# include custom receiver/processor components alongside the standard contrib ones. |
8 | 12 | # Note: Build context must be repo root (use: docker build -f docker/otel-collector/Dockerfile .) |
9 | | -FROM golang:1.25-alpine AS migrate-builder |
| 13 | +# Note: The official OCB image may ship an older Go than the contrib modules require, |
| 14 | +# so we copy the ocb binary into a golang base with a newer toolchain. |
| 15 | +FROM otel/opentelemetry-collector-builder:${OTEL_COLLECTOR_VERSION} AS ocb-bin |
| 16 | +FROM golang:1.26-alpine AS ocb-builder |
| 17 | +ARG OTEL_COLLECTOR_VERSION |
| 18 | +ARG OTEL_COLLECTOR_CORE_VERSION |
| 19 | +COPY --from=ocb-bin /usr/local/bin/ocb /usr/local/bin/ocb |
| 20 | +WORKDIR /build |
| 21 | +COPY packages/otel-collector/builder-config.yaml . |
| 22 | +RUN sed -i "s/__OTEL_COLLECTOR_VERSION__/${OTEL_COLLECTOR_VERSION}/g; s/__OTEL_COLLECTOR_CORE_VERSION__/${OTEL_COLLECTOR_CORE_VERSION}/g" builder-config.yaml && \ |
| 23 | + CGO_ENABLED=0 ocb --config=builder-config.yaml |
| 24 | + |
| 25 | +# Build the Go migration tool with full TLS support for ClickHouse |
| 26 | +FROM golang:1.26-alpine AS migrate-builder |
10 | 27 | WORKDIR /build |
11 | 28 | COPY packages/otel-collector/go.mod packages/otel-collector/go.sum ./ |
12 | 29 | RUN go mod download |
@@ -38,7 +55,7 @@ COPY --from=migrate-builder /migrate /usr/local/bin/migrate |
38 | 55 | USER ${USER_UID}:${USER_GID} |
39 | 56 |
|
40 | 57 | COPY --from=supervisor --chmod=755 /usr/local/bin/opampsupervisor /opampsupervisor |
41 | | -COPY --from=col --chmod=755 /otelcol-contrib /otelcontribcol |
| 58 | +COPY --from=ocb-builder --chmod=755 /build/output/otelcol-hyperdx /otelcontribcol |
42 | 59 |
|
43 | 60 | # Copy entrypoint and log tail wrapper scripts |
44 | 61 | COPY --chmod=755 docker/otel-collector/entrypoint.sh /entrypoint.sh |
|
0 commit comments