File tree Expand file tree Collapse file tree 6 files changed +292
-392
lines changed Expand file tree Collapse file tree 6 files changed +292
-392
lines changed Original file line number Diff line number Diff line change
1
+ # Download base image
2
+ FROM telegraf:latest
3
+
4
+ # Add support tool
5
+ RUN apt update && apt install -y rsync
6
+
7
+ # where IOTstack template files are stored
8
+ ENV IOTSTACK_DEFAULTS_DIR="iotstack_defaults"
9
+
10
+ # make a copy of the default config file
11
+ RUN mkdir -p /${IOTSTACK_DEFAULTS_DIR} && \
12
+ cp /etc/telegraf/telegraf.conf /${IOTSTACK_DEFAULTS_DIR}/
13
+
14
+ # replace the docker entry-point script with a self-repairing version
15
+ ENV IOTSTACK_ENTRY_POINT="entrypoint.sh"
16
+ COPY ${IOTSTACK_ENTRY_POINT} /${IOTSTACK_ENTRY_POINT}
17
+ RUN chmod 755 /${IOTSTACK_ENTRY_POINT}
18
+ ENV IOTSTACK_ENTRY_POINT=
19
+
20
+ # IOTstack declares this path for persistent storage
21
+ VOLUME ["/etc/telegraf" ]
22
+
23
+ # EOF
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ if [ " ${1: 0: 1} " = ' -' ]; then
5
+ set -- telegraf " $@ "
6
+ fi
7
+
8
+ # perform IOTstack self-repair
9
+ U=" $( id -u) "
10
+ T=" /etc/telegraf"
11
+ if [ " $U " = ' 0' -a -d " $T " ]; then
12
+ rsync -arp --ignore-existing /${IOTSTACK_DEFAULTS_DIR} / " $T "
13
+ chown -R " $U :$U " " $T "
14
+ fi
15
+
16
+ exec " $@ "
17
+
18
+
Original file line number Diff line number Diff line change 1
1
telegraf :
2
2
container_name : telegraf
3
- image : telegraf
3
+ build : ./.templates/ telegraf/.
4
4
restart : unless-stopped
5
+ environment :
6
+ - TZ=Etc/UTC
7
+ ports :
8
+ - " 8092:8092/udp"
9
+ - " 8094:8094/tcp"
10
+ - " 8125:8125/udp"
5
11
volumes :
6
- - ./services /telegraf/telegraf.conf :/etc/telegraf/telegraf.conf:ro
12
+ - ./volumes /telegraf/:/etc/telegraf
7
13
depends_on :
8
14
- influxdb
9
15
- mosquitto
10
16
networks :
11
17
- iotstack_nw
18
+
You can’t perform that action at this time.
0 commit comments