64 lines
2.2 KiB
Docker
Executable File
64 lines
2.2 KiB
Docker
Executable File
ARG BUILD_FROM
|
|
FROM ${BUILD_FROM}
|
|
|
|
# Build arguments
|
|
ARG BUILD_ARCH
|
|
ARG BUILD_DATE
|
|
ARG BUILD_DESCRIPTION
|
|
ARG BUILD_NAME
|
|
ARG BUILD_REF
|
|
ARG BUILD_REPOSITORY
|
|
ARG BUILD_VERSION
|
|
ARG TELEGRAF_VERSION
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends iputils-ping snmp procps lm-sensors libcap2-bin && \
|
|
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 ${TELEGRAF_VERSION}
|
|
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*
|
|
|
|
EXPOSE 8125/udp 8092/udp 8094
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["telegraf"]
|
|
|
|
# Labels
|
|
LABEL \
|
|
io.hass.name="${BUILD_NAME}" \
|
|
io.hass.description="${BUILD_DESCRIPTION}" \
|
|
io.hass.arch="${BUILD_ARCH}" \
|
|
io.hass.type="addon" \
|
|
io.hass.version=${BUILD_VERSION} \
|
|
maintainer="fbonelle" \
|
|
org.opencontainers.image.title="${BUILD_NAME}" \
|
|
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
|
|
org.opencontainers.image.vendor="fbonelle's addons" \
|
|
org.opencontainers.image.authors="fbonelle" \
|
|
org.opencontainers.image.licenses="MIT" \
|
|
org.opencontainers.image.created=${BUILD_DATE} \
|
|
org.opencontainers.image.revision=${BUILD_REF} \
|
|
org.opencontainers.image.version=${BUILD_VERSION}
|