63 lines
2.2 KiB
Docker
Executable File
63 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
|
|
|
|
# Environment variables
|
|
ENV \
|
|
HOME="/root" \
|
|
LANG="C.UTF-8" \
|
|
PS1="$(whoami)@$(hostname):$(pwd)$ " \
|
|
TERM="xterm-256color"
|
|
|
|
# Copy root filesystem
|
|
COPY rootfs /
|
|
|
|
# Set shell
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends bash ca-certificates curl jq tzdata xz-utils iputils-ping snmp procps lm-sensors libcap2-bin wget gnupg && \
|
|
c_rehash && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV TELEGRAF_VERSION ${TELEGRAF_VERSION}
|
|
RUN set -ex && \
|
|
mkdir ~/.gnupg && \
|
|
chmod 600 ~/.gnupg/* && \
|
|
chmod 700 ~/.gnupg && \
|
|
echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \
|
|
wget -q https://repos.influxdata.com/influxdata-archive_compat.key && \
|
|
echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null && \
|
|
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | tee /etc/apt/sources.list.d/influxdata.list && \
|
|
apt-get update && \
|
|
apt-get install telegraf=${TELEGRAF_VERSION} && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
EXPOSE 8125/udp 8092/udp 8094
|
|
|
|
# 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}
|