<filename>plugins/input-internal/Dockerfile
FROM juniper/pyez:2.0.1

WORKDIR /source
USER root

## To be removed once change merge upstream
RUN apk add --no-cache ca-certificates && \
    update-ca-certificates
RUN apk add --no-cache wget git

# 20220315 JES
#ARG TELEGRAF_VERSION=1.2.1
ARG TELEGRAF_VERSION=1.21.4

#############################
## Install Telegraf
#############################
# 20220315 JES
#RUN wget -q https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}-static_linux_amd64.tar.gz && \
#    mkdir -p /usr/src /etc/telegraf && \
#    tar -C /usr/src -xzf telegraf-${TELEGRAF_VERSION}-static_linux_amd64.tar.gz && \
#    mv /usr/src/telegraf*/telegraf.conf /etc/telegraf/ && \
#    chmod +x /usr/src/telegraf*/* && \
#    cp -a /usr/src/telegraf*/* /usr/bin/ && \
#    rm -rf *.tar.gz* /usr/src /root/.gnupg
# https://dl.influxdata.com/telegraf/releases/telegraf-1.21.4_static_linux_amd64.tar.gz
RUN wget -q https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}_static_linux_amd64.tar.gz && \
    mkdir -p /usr/src /etc/telegraf && \
    tar -C /usr/src -xzf telegraf-${TELEGRAF_VERSION}_static_linux_amd64.tar.gz && \
    mv /usr/src/telegraf*/etc/telegraf/telegraf.conf /etc/telegraf/ && \
    chmod +x /usr/src/telegraf*/* && \
    cp -a /usr/src/telegraf*/* /usr/bin/ && \
    rm -rf *.tar.gz* /usr/src /root/.gnupg


COPY start-input-internal.sh /source/start-input-internal.sh
RUN chmod +x /source/start-input-internal.sh

RUN mkdir /data
ADD templates /data/templates/
WORKDIR /data

CMD ["/source/start-input-internal.sh"]
