console/docker/otel-collector.dockerfile
Laurin Quast 4f70fc9555
feat: otel telemetry collection and dashboard (#6796)
Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
Co-authored-by: Dotan Simha <dotansimha@gmail.com>
Co-authored-by: Denis Badurina <denis@denelop.com>
2025-10-10 14:06:02 +02:00

34 lines
848 B
Docker

FROM scratch AS config
COPY builder-config.yaml .
COPY extension-hiveauth/ ./extension-hiveauth/
FROM golang:1.23.7-bookworm AS builder
ARG OTEL_VERSION=0.122.0
WORKDIR /build
RUN go install go.opentelemetry.io/collector/cmd/builder@v${OTEL_VERSION}
# Copy the manifest file and other necessary files
COPY --from=config builder-config.yaml .
COPY --from=config extension-hiveauth/ ./extension-hiveauth/
# Build the custom collector
RUN CGO_ENABLED=0 builder --config=/build/builder-config.yaml
# Stage 2: Final Image
FROM alpine:3.14
WORKDIR /app
# Copy the generated collector binary from the builder stage
COPY --from=builder /build/otelcol-custom .
COPY config.yaml /etc/otel-config.yaml
# Expose necessary ports
EXPOSE 4317/tcp 4318/tcp 13133/tcp
# Set the default command
CMD ["./otelcol-custom", "--config=/etc/otel-config.yaml"]