Added Telegraf

This commit is contained in:
2021-01-09 15:24:55 +01:00
parent 08f16bb11a
commit 1b10bb75d1
2 changed files with 26 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
repository: [restic-auto, influxdb]
repository: [restic-auto, influxdb, telegraf]
steps:
- name: Checkout

25
telegraf/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM alpine:latest AS builder
ARG TARGETPLATFORM
RUN apk add --no-cache curl jq \
&& VERSION=$(curl -s https://api.github.com/repos/influxdata/telegraf/releases/latest | jq '.name' | sed -E "s/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/") \
&& curl -s -o entrypoint.sh https://raw.githubusercontent.com/influxdata/influxdata-docker/master/telegraf/1.17/alpine/entrypoint.sh \
&& DOWNLOAD_ARCH=$(echo ${TARGETPLATFORM} | sed "s#/#_#") \
&& curl -s -o telegraf.tgz https://dl.influxdata.com/telegraf/releases/telegraf-${VERSION}_${DOWNLOAD_ARCH}.tar.gz \
&& tar -z -x -f telegraf.tgz
FROM alpine:3.12
COPY --from=builder telegraf*/usr/bin/telegraf /usr/bin/
COPY --from=builder entrypoint.sh /entrypoint.sh
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf \
&& apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata \
&& update-ca-certificates \
&& chmod +x /usr/bin/telegraf /entrypoint.sh
EXPOSE 8125/udp 8092/udp 8094
ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"]