11FROM alpine:3.15
22
33RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
4- RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec libcap && \
4+ RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec libcap gnupg && \
55 update-ca-certificates
66
7+ RUN for attempt in 1 2 3 ; \
8+ do \
9+ sleep 1 && \
10+ gpg --yes --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys \
11+ 05CE15085FC09D18E99EFB22684A14CF2582E0C5 && \
12+ break ; \
13+ done
14+
715ENV TELEGRAF_VERSION 1.21.4
816
917RUN set -ex && \
10- mkdir ~/.gnupg; \
11- echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
12- apk add --no-cache --virtual .build-deps wget gnupg tar && \
13- for key in \
14- 05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \
15- do \
16- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$key" ; \
17- done && \
18+ apk add --no-cache --virtual .build-deps wget tar && \
1819 wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}_static_linux_amd64.tar.gz.asc && \
1920 wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}_static_linux_amd64.tar.gz && \
2021 gpg --batch --verify telegraf-${TELEGRAF_VERSION}_static_linux_amd64.tar.gz.asc telegraf-${TELEGRAF_VERSION}_static_linux_amd64.tar.gz && \
@@ -23,8 +24,7 @@ RUN set -ex && \
2324 mv /usr/src/telegraf*/etc/telegraf/telegraf.conf /etc/telegraf/ && \
2425 mkdir /etc/telegraf/telegraf.d && \
2526 cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
26- gpgconf --kill all && \
27- rm -rf *.tar.gz* /usr/src /root/.gnupg && \
27+ rm -rf *.tar.gz* /usr/src && \
2828 apk del .build-deps && \
2929 addgroup -S telegraf && \
3030 adduser -S telegraf -G telegraf && \
0 commit comments