Skip to content

Commit 314576c

Browse files
committed
telegraf: update alpine dockerfiles
* consolidates the addgroup & adduser commands * sets the owner & group of the /etc/telegraf directory to the new telegraf user & group
1 parent 8352018 commit 314576c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

telegraf/1.18/alpine/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ RUN set -ex && \
2525
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
2626
gpgconf --kill all && \
2727
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
28-
apk del .build-deps
28+
apk del .build-deps && \
29+
addgroup -S telegraf && \
30+
adduser -S telegraf -G telegraf && \
31+
chown -R telegraf:telegraf /etc/telegraf
2932

3033
EXPOSE 8125/udp 8092/udp 8094
3134

32-
RUN addgroup -S telegraf
33-
RUN adduser -S telegraf -G telegraf
3435
USER telegraf
3536

3637
COPY entrypoint.sh /entrypoint.sh

telegraf/1.19/alpine/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ RUN set -ex && \
2525
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
2626
gpgconf --kill all && \
2727
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
28-
apk del .build-deps
28+
apk del .build-deps && \
29+
addgroup -S telegraf && \
30+
adduser -S telegraf -G telegraf && \
31+
chown -R telegraf:telegraf /etc/telegraf
2932

3033
EXPOSE 8125/udp 8092/udp 8094
3134

32-
RUN addgroup -S telegraf
33-
RUN adduser -S telegraf -G telegraf
3435
USER telegraf
3536

3637
COPY entrypoint.sh /entrypoint.sh

telegraf/1.20/alpine/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ RUN set -ex && \
2525
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
2626
gpgconf --kill all && \
2727
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
28-
apk del .build-deps
28+
apk del .build-deps && \
29+
addgroup -S telegraf && \
30+
adduser -S telegraf -G telegraf && \
31+
chown -R telegraf:telegraf /etc/telegraf
2932

3033
EXPOSE 8125/udp 8092/udp 8094
3134

32-
RUN addgroup -S telegraf
33-
RUN adduser -S telegraf -G telegraf
3435
USER telegraf
3536

3637
COPY entrypoint.sh /entrypoint.sh

0 commit comments

Comments
 (0)