-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update collector to build image using ocb
The collector in this repository now uses the otel collector builder to build a custom binary which it embeds in a docker container for the demo. Still to do: - [ ] update curl command to pull builder for specific architectures - [ ] allow passing the version of the builder to use Signed-off-by: Alex Boten <alex@boten.ca>
- Loading branch information
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM golang:latest as build | ||
|
||
ARG TARGETARCH=arm64 | ||
ARG BUILDER_VERSION=0.81.0 | ||
|
||
RUN curl -L -o /builder https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2Fv${BUILDER_VERSION}/ocb_${BUILDER_VERSION}_linux_${TARGETARCH} | ||
RUN chmod +x /builder | ||
WORKDIR /build | ||
COPY ./src/otelcollector/manifest.yml ./ | ||
ENV GOARCH=arm64 | ||
ENV CGO_ENABLED=0 | ||
RUN /builder --config ./manifest.yml --output-path /build/_build | ||
RUN ls /build/_build | ||
|
||
FROM alpine:3.16 as certs | ||
RUN apk --update add ca-certificates | ||
|
||
FROM alpine | ||
|
||
ARG USER_UID=10001 | ||
USER ${USER_UID} | ||
|
||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=build --chmod=755 /build/_build/otelcol-demo /otelcol-demo | ||
COPY ./src/otelcollector/otelcol-*.yml /etc/otelcol/ | ||
ENTRYPOINT ["/otelcol-demo"] | ||
CMD ["--config", "/etc/otelcol/otelcol-config.yml"] | ||
EXPOSE 4317 4318 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
dist: | ||
module: github.com/open-telemetry/opentelemetry-demo/src/otelcollector | ||
name: otelcol-demo | ||
description: OpenTelemetry Collector for OpenTelemetry Demo | ||
version: 0.81.0 | ||
output_path: ./_build | ||
otelcol_version: 0.81.0 | ||
|
||
receivers: | ||
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.81.0 | ||
|
||
exporters: | ||
- gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.81.0 | ||
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.81.0 | ||
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.81.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.81.0 | ||
processors: | ||
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.81.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.81.0 | ||
connectors: | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.81.0 |