Skip to content

Commit a23175c

Browse files
committed
telegraf: add CAP_NET_RAW and NET_BIND_SERVICE capabilities
Resolves: #547
1 parent 725fae9 commit a23175c

File tree

8 files changed

+16
-0
lines changed

8 files changed

+16
-0
lines changed

telegraf/1.18/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
2626
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
2727
gpg --batch --verify telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb.asc telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
2828
dpkg -i telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
29+
setcap cap_net_raw+ep /usr/bin/telegraf && \
30+
setcap net_bind_service+ep /usr/bin/telegraf && \
2931
rm -f telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb*
3032

3133
EXPOSE 8125/udp 8092/udp 8094

telegraf/1.18/alpine/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN set -ex && \
2323
mv /usr/src/telegraf*/etc/telegraf/telegraf.conf /etc/telegraf/ && \
2424
mkdir /etc/telegraf/telegraf.d && \
2525
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
26+
setcap cap_net_raw+ep /usr/bin/telegraf && \
27+
setcap net_bind_service+ep /usr/bin/telegraf && \
2628
gpgconf --kill all && \
2729
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
2830
apk del .build-deps && \

telegraf/1.19/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
2626
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
2727
gpg --batch --verify telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb.asc telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
2828
dpkg -i telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
29+
setcap cap_net_raw+ep /usr/bin/telegraf && \
30+
setcap net_bind_service+ep /usr/bin/telegraf && \
2931
rm -f telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb*
3032

3133
EXPOSE 8125/udp 8092/udp 8094

telegraf/1.19/alpine/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN set -ex && \
2323
mv /usr/src/telegraf*/etc/telegraf/telegraf.conf /etc/telegraf/ && \
2424
mkdir /etc/telegraf/telegraf.d && \
2525
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
26+
setcap cap_net_raw+ep /usr/bin/telegraf && \
27+
setcap net_bind_service+ep /usr/bin/telegraf && \
2628
gpgconf --kill all && \
2729
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
2830
apk del .build-deps && \

telegraf/1.20/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
2626
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
2727
gpg --batch --verify telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb.asc telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
2828
dpkg -i telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
29+
setcap cap_net_raw+ep /usr/bin/telegraf && \
30+
setcap net_bind_service+ep /usr/bin/telegraf && \
2931
rm -f telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb*
3032

3133
EXPOSE 8125/udp 8092/udp 8094

telegraf/1.20/alpine/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN set -ex && \
2323
mv /usr/src/telegraf*/etc/telegraf/telegraf.conf /etc/telegraf/ && \
2424
mkdir /etc/telegraf/telegraf.d && \
2525
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
26+
setcap cap_net_raw+ep /usr/bin/telegraf && \
27+
setcap net_bind_service+ep /usr/bin/telegraf && \
2628
gpgconf --kill all && \
2729
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
2830
apk del .build-deps && \

telegraf/nightly/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
1515
esac && \
1616
wget --no-verbose https://dl.influxdata.com/telegraf/nightlies/telegraf_${TELEGRAF_VERSION}_${ARCH}.deb && \
1717
dpkg -i telegraf_${TELEGRAF_VERSION}_${ARCH}.deb && \
18+
setcap cap_net_raw+ep /usr/bin/telegraf && \
19+
setcap net_bind_service+ep /usr/bin/telegraf && \
1820
rm -f telegraf_${TELEGRAF_VERSION}_${ARCH}.deb*
1921

2022
EXPOSE 8125/udp 8092/udp 8094

telegraf/nightly/alpine/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ RUN set -ex && \
1414
mv /usr/src/telegraf*/etc/telegraf/telegraf.conf /etc/telegraf/ && \
1515
mkdir /etc/telegraf/telegraf.d && \
1616
cp -a /usr/src/telegraf*/usr/bin/telegraf /usr/bin/ && \
17+
setcap cap_net_raw+ep /usr/bin/telegraf && \
18+
setcap net_bind_service+ep /usr/bin/telegraf && \
1719
rm -rf *.tar.gz* /usr/src && \
1820
apk del .build-deps && \
1921
addgroup -S telegraf && \

0 commit comments

Comments
 (0)