-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
57 lines (48 loc) · 2.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM buildpack-deps:buster-curl
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends iputils-ping snmp procps lm-sensors && \
rm -rf /var/lib/apt/lists/*
RUN set -ex && \
mkdir ~/.gnupg; \
echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
for key in \
05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \
do \
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys "$key" ; \
done
ENV TELEGRAF_VERSION 1.20.2
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
case "${dpkgArch##*-}" in \
amd64) ARCH='amd64';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armhf';; \
armel) ARCH='armel';; \
*) echo "Unsupported architecture: ${dpkgArch}"; exit 1;; \
esac && \
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb.asc && \
wget --no-verbose https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
gpg --batch --verify telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb.asc telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
dpkg -i telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb && \
rm -f telegraf_${TELEGRAF_VERSION}-1_${ARCH}.deb*
# let's not do this we are only outbound for our use case.
#EXPOSE 8125/udp 8092/udp 8094
# handy for editing configs when debugging container configs
# RUN apt-get update && apt-get install apt-file -y && apt-file update && apt-get install vim -y
COPY entrypoint.sh /entrypoint.sh
# copy over any templates for telegraf config
COPY ./conf/* /
# config validation
# we want the container build to fail if there is a syntax error in the builtin configs
ENV SUMO_URL="http://your_url"
ENV env="demo"
ENV ip=1.2.3.4
ENV location=docker_build
ENV service=docker_service
ENV urls=localhost
RUN telegraf --config ping.conf --test
ENV urls=http://localhost
RUN telegraf --config http_response.conf --test
RUN telegraf --config statsd.conf --test
#RUN telegraf --config internet_speed.conf --test
ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"]