|
1 |
| -FROM alpine:3.12 as certs |
| 1 | +ARG SMART_AGENT_RELEASE=v5.9.1 |
| 2 | +ARG ALPINE_VERSION=3.12 |
| 3 | + |
| 4 | +FROM alpine:${ALPINE_VERSION} as certs |
2 | 5 | RUN apk --update add ca-certificates
|
3 | 6 |
|
4 |
| -FROM alpine:3.12 AS otelcol |
| 7 | +FROM alpine:${ALPINE_VERSION} AS otelcol |
5 | 8 | COPY otelcol /
|
6 | 9 | # Note that this shouldn't be necessary, but in some cases the file seems to be
|
7 | 10 | # copied with the execute bit lost (see #1317)
|
8 | 11 | RUN chmod 755 /otelcol
|
9 | 12 |
|
| 13 | +FROM alpine:${ALPINE_VERSION} AS smartagent |
| 14 | +ARG SMART_AGENT_RELEASE |
| 15 | +RUN mkdir -p "$(dirname "/usr/lib/splunk-otel-collector/agent-bundle")" && \ |
| 16 | + SMART_AGENT=signalfx-agent-${SMART_AGENT_RELEASE#v}.tar.gz && \ |
| 17 | + URL=https://github.com/signalfx/signalfx-agent/releases/download/${SMART_AGENT_RELEASE}/$SMART_AGENT && \ |
| 18 | + wget "$URL" && tar -xzf $SMART_AGENT && mv signalfx-agent /usr/lib/splunk-otel-collector/agent-bundle && \ |
| 19 | + # Absolute path of interpreter in smart agent dir is set in dependent binaries |
| 20 | + # requiring the interpreter location not to change. |
| 21 | + /usr/lib/splunk-otel-collector/agent-bundle/bin/patch-interpreter /usr/lib/splunk-otel-collector/agent-bundle && \ |
| 22 | + rm -f /usr/lib/splunk-otel-collector/agent-bundle/bin/signalfx-agent \ |
| 23 | + /usr/lib/splunk-otel-collector/agent-bundle/bin/agent-status \ |
| 24 | + $SMART_AGENT |
| 25 | + |
10 | 26 | FROM scratch
|
| 27 | +ENV SPLUNK_BUNDLE_DIR=/usr/lib/splunk-otel-collector/agent-bundle |
| 28 | +ENV SPLUNK_COLLECTD_DIR=$SIGNALFX_BUNDLE_DIR/run/collectd |
11 | 29 | COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
12 | 30 | COPY --from=otelcol /otelcol /
|
13 |
| -COPY config/collector/gateway_config.yaml /etc/otel/collector/gateway_config.yaml |
| 31 | +# Maintaining interpreter location as required. |
| 32 | +COPY --from=smartagent /usr/lib/splunk-otel-collector/agent-bundle /usr/lib/splunk-otel-collector/agent-bundle |
| 33 | +COPY config/collector/gateway_config.yaml /etc/otel/collector/gateway_config.yaml |
14 | 34 | COPY config/collector/otlp_config_linux.yaml /etc/otel/collector/otlp_config_linux.yaml
|
| 35 | +COPY config/collector/agent_config.yaml /etc/otel/collector/agent_config.yaml |
15 | 36 | ENTRYPOINT ["/otelcol"]
|
16 | 37 | EXPOSE 13133 14250 14268 55680 4317 6060 7276 8888 9411 9443
|
0 commit comments