File tree Expand file tree Collapse file tree 12 files changed +33
-21
lines changed Expand file tree Collapse file tree 12 files changed +33
-21
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
30
30
31
31
EXPOSE 8125/udp 8092/udp 8094
32
32
33
- USER telegraf
34
-
35
33
COPY entrypoint.sh /entrypoint.sh
36
34
ENTRYPOINT ["/entrypoint.sh" ]
37
35
CMD ["telegraf" ]
Original file line number Diff line number Diff line change 1
1
FROM alpine:3.14
2
2
3
3
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
4
- RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata && \
4
+ RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec && \
5
5
update-ca-certificates
6
6
7
7
ENV TELEGRAF_VERSION 1.18.3
@@ -32,8 +32,6 @@ RUN set -ex && \
32
32
33
33
EXPOSE 8125/udp 8092/udp 8094
34
34
35
- USER telegraf
36
-
37
35
COPY entrypoint.sh /entrypoint.sh
38
36
ENTRYPOINT ["/entrypoint.sh" ]
39
37
CMD ["telegraf" ]
Original file line number Diff line number Diff line change @@ -5,4 +5,8 @@ if [ "${1:0:1}" = '-' ]; then
5
5
set -- telegraf " $@ "
6
6
fi
7
7
8
- exec " $@ "
8
+ if [ $EUID -ne 0 ]; then
9
+ exec " $@ "
10
+ else
11
+ exec su-exec telegraf " $@ "
12
+ fi
Original file line number Diff line number Diff line change @@ -5,4 +5,8 @@ if [ "${1:0:1}" = '-' ]; then
5
5
set -- telegraf " $@ "
6
6
fi
7
7
8
- exec " $@ "
8
+ if [ $EUID -ne 0 ]; then
9
+ exec " $@ "
10
+ else
11
+ exec setpriv --reuid telegraf --init-groups " $@ "
12
+ fi
Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
30
30
31
31
EXPOSE 8125/udp 8092/udp 8094
32
32
33
- USER telegraf
34
-
35
33
COPY entrypoint.sh /entrypoint.sh
36
34
ENTRYPOINT ["/entrypoint.sh" ]
37
35
CMD ["telegraf" ]
Original file line number Diff line number Diff line change 1
1
FROM alpine:3.14
2
2
3
3
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
4
- RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata && \
4
+ RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec && \
5
5
update-ca-certificates
6
6
7
7
ENV TELEGRAF_VERSION 1.19.3
@@ -32,8 +32,6 @@ RUN set -ex && \
32
32
33
33
EXPOSE 8125/udp 8092/udp 8094
34
34
35
- USER telegraf
36
-
37
35
COPY entrypoint.sh /entrypoint.sh
38
36
ENTRYPOINT ["/entrypoint.sh" ]
39
37
CMD ["telegraf" ]
Original file line number Diff line number Diff line change @@ -5,4 +5,8 @@ if [ "${1:0:1}" = '-' ]; then
5
5
set -- telegraf " $@ "
6
6
fi
7
7
8
- exec " $@ "
8
+ if [ $EUID -ne 0 ]; then
9
+ exec " $@ "
10
+ else
11
+ exec su-exec telegraf " $@ "
12
+ fi
Original file line number Diff line number Diff line change @@ -5,4 +5,8 @@ if [ "${1:0:1}" = '-' ]; then
5
5
set -- telegraf " $@ "
6
6
fi
7
7
8
- exec " $@ "
8
+ if [ $EUID -ne 0 ]; then
9
+ exec " $@ "
10
+ else
11
+ exec setpriv --reuid telegraf --init-groups " $@ "
12
+ fi
Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
30
30
31
31
EXPOSE 8125/udp 8092/udp 8094
32
32
33
- USER telegraf
34
-
35
33
COPY entrypoint.sh /entrypoint.sh
36
34
ENTRYPOINT ["/entrypoint.sh" ]
37
35
CMD ["telegraf" ]
Original file line number Diff line number Diff line change 1
1
FROM alpine:3.14
2
2
3
3
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
4
- RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata && \
4
+ RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors tzdata su-exec && \
5
5
update-ca-certificates
6
6
7
7
ENV TELEGRAF_VERSION 1.20.3
@@ -32,8 +32,6 @@ RUN set -ex && \
32
32
33
33
EXPOSE 8125/udp 8092/udp 8094
34
34
35
- USER telegraf
36
-
37
35
COPY entrypoint.sh /entrypoint.sh
38
36
ENTRYPOINT ["/entrypoint.sh" ]
39
37
CMD ["telegraf" ]
You can’t perform that action at this time.
0 commit comments