84 lines
2.8 KiB
Docker
Executable File
84 lines
2.8 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
|
|
ARG BASHIO_VERSION
|
|
ARG TEMPIO_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 && \
|
|
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/*
|
|
|
|
RUN curl -J -L -o /tmp/bashio.tar.gz \
|
|
"https://github.com/hassio-addons/bashio/archive/${BASHIO_VERSION}.tar.gz" && \
|
|
mkdir /tmp/bashio && \
|
|
tar zxvf \
|
|
/tmp/bashio.tar.gz \
|
|
--strip 1 -C /tmp/bashio && \
|
|
mv /tmp/bashio/lib /usr/lib/bashio && \
|
|
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
|
|
curl -L -s -o /usr/bin/tempio \
|
|
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" && \
|
|
chmod a+x /usr/bin/tempio && \
|
|
rm -fr \
|
|
/tmp/*
|
|
|
|
EXPOSE 8125/udp 8092/udp 8094
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
COPY settings.sh /settings.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}
|