-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdockerfile
30 lines (21 loc) · 882 Bytes
/
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
FROM telegraf:1.27 as base
RUN apt update && apt install -y python3 python3-xmltodict python3-ncclient \
&& mkdir /opt/netconf_client
FROM base as telegraf
EXPOSE 57500
ARG TELEGRAF_BUCKET
ARG TELEGRAF_ORG
ARG TELEGRAF_TOKEN
ENV TELEGRAF_BUCKET=${TELEGRAF_BUCKET}
ENV TELEGRAF_ORG=${TELEGRAF_ORG}
ENV TELEGRAF_TOKEN=${TELEGRAF_TOKEN}
COPY telegraf/telegraf.conf /etc/telegraf/telegraf.conf
COPY telegraf/netconf.conf /etc/telegraf/telegraf.d/netconf.conf
COPY telegraf/grpc.conf /etc/telegraf/telegraf.d/grpc.conf
COPY netconf_client/ /opt/netconf_client/
RUN chmod +x /opt/netconf_client/*.py
# Run from root dir
# docker build --target telegraf --file telegraf.dockerfile --tag telegraf:test .
# docker run -itd -p 57500:57500 --name telegraf --add-host host.docker.internal:host-gateway telegraf:test
# docker exec -it telegraf bash
# tail -F /tmp/telegraf-grpc.log