mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-11-03 02:20:04 +00:00
30 lines
908 B
Docker
30 lines
908 B
Docker
# use a minimal alpine image
|
|
FROM alpine:3.17
|
|
|
|
# add ca-certificates in case you need them
|
|
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
|
|
|
# define arguments and default values
|
|
ARG TARGETOS TARGETARCH
|
|
ARG USER_UID=10001
|
|
|
|
# create a non-root user for running the collector
|
|
USER ${USER_UID}
|
|
|
|
# copy the binaries from the multi-stage build
|
|
COPY .build/${TARGETOS}-${TARGETARCH}/signoz-collector /signoz-collector
|
|
|
|
# copy the config and migration files
|
|
COPY config/default-config.yaml /etc/otel/config.yaml
|
|
COPY exporter/clickhousetracesexporter/migrations /migrations
|
|
COPY exporter/clickhouselogsexporter/migrations /logsmigrations
|
|
|
|
ENV LOG_MIGRATIONS_FOLDER="/logsmigrations"
|
|
|
|
# expose OTLP ports for the collector
|
|
EXPOSE 4317 4318
|
|
|
|
# run the binary as the entrypoint and pass the default config file as a flag
|
|
ENTRYPOINT [ "/signoz-collector" ]
|
|
CMD ["--config", "/etc/otel/config.yaml"]
|