This commit is contained in:
2022-02-20 15:20:31 +01:00
parent 308a14cfb0
commit 32c8bd2302
5 changed files with 38 additions and 40 deletions

View File

@@ -5,23 +5,44 @@ FROM ${BUILD_FROM}
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base system # Setup base system
ARG BUILD_ARCH=amd64 ARG BUILD_ARCH
# Syslog-ng version
ARG SYSLOG_NG_VERSION
# Install syslog-ng # Install syslog-ng
RUN \ RUN \
apt-get update -qq && \ echo "**** install packages ****" && \
apt-get install -y wget ca-certificates gnupg2 debian-ports-archive-keyring xz-utils dirmngr systemd && \ apk add -U --upgrade --no-cache \
wget -qO - https://ose-repo.syslog-ng.com/apt/syslog-ng-ose-pub.asc | gpg --dearmor > /usr/share/keyrings/ose-repo-archive-keyring.gpg && \ curl && \
echo "deb [ signed-by=/usr/share/keyrings/ose-repo-archive-keyring.gpg ] https://ose-repo.syslog-ng.com/apt/ stable debian-testing" | tee --append /etc/apt/sources.list.d/syslog-ng-ose.list && \ if [ -z ${SYSLOG_NG_VERSION+x} ]; then \
apt-get update -qq && \ SYSLOG_NG_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
apt-get install -y libdbd-mysql libdbd-pgsql libdbd-sqlite3 syslog-ng && \ && awk '/^P:syslog-ng$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
rm -fr /tmp/* /var/{cache,log}/* /var/lib/apt/lists/* fi && \
apk add -U --upgrade --no-cache \
syslog-ng==${SYSLOG_NG_VERSION} \
syslog-ng-add-contextual-data \
syslog-ng-amqp \
syslog-ng-graphite \
syslog-ng-http \
syslog-ng-json \
syslog-ng-map-value-pairs \
syslog-ng-redis \
syslog-ng-scl \
syslog-ng-sql \
syslog-ng-stardate \
syslog-ng-stomp \
syslog-ng-tags-parser \
syslog-ng-xml \
py3-syslog-ng && \
rm -rf \
/tmp/*
# Copy root filesystem # Copy root filesystem
COPY rootfs / COPY rootfs /
# Expose ports # Expose ports
EXPOSE 514/udp 601/tcp 6514/tcp EXPOSE 5514/udp 6601/tcp 6514/tcp
# Define HealthCheck # Define HealthCheck
HEALTHCHECK --interval=2m --timeout=3s --start-period=30s CMD /usr/sbin/syslog-ng-ctl stats || exit 1 HEALTHCHECK --interval=2m --timeout=3s --start-period=30s CMD /usr/sbin/syslog-ng-ctl stats || exit 1

View File

@@ -1,6 +1,6 @@
build_from: build_from:
aarch64: ghcr.io/hassio-addons/debian-base/aarch64:5.2.3 aarch64: ghcr.io/hassio-addons/addon-base/aarch64:v11.0.1
amd64: ghcr.io/hassio-addons/debian-base/amd64:5.2.3 amd64: ghcr.io/hassio-addons/addon-base/amd64:v11.0.1
armhf: ghcr.io/hassio-addons/debian-base/armhf:5.2.3 armhf: ghcr.io/hassio-addons/addon-base/armhf:v11.0.1
armv7: ghcr.io/hassio-addons/debian-base/armv7:5.2.3 armv7: ghcr.io/hassio-addons/addon-base/armv7:v11.0.1
i386: ghcr.io/hassio-addons/debian-base/i386:5.2.3 i386: ghcr.io/hassio-addons/addon-base/i386:v11.0.1

View File

@@ -14,8 +14,8 @@ arch:
- armv7 - armv7
- i386 - i386
ports: ports:
514/udp: null 5514/udp: null
601/tcp: null 6601/tcp: null
6514/tcp: null 6514/tcp: null
apparmor: false apparmor: false
map: map:
@@ -27,7 +27,7 @@ map:
journald: true journald: true
options: options:
custom_conf: custom_conf:
location: "/config/syslog-ng.conf" location: "/config/syslog-ng/syslog-ng.conf"
schema: schema:
custom_conf: custom_conf:
location: str location: str

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-on: Glances
# This file turns s6-nuke into a NOOP to prevent total termination
# of the host system since the add-on runs in the same PID namespace.
# ==============================================================================
echo "S6-NUKE: NOOP"
exit 0

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bashio
declare hostname
bashio::require.unprotected
readonly CONFIG="/etc/telegraf/telegraf.conf"
CUSTOM_CONF=$(bashio::config 'custom_conf.location')
bashio::log.info "Using custom conf file"
rm /etc/telegraf/telegraf.conf
cp "${CUSTOM_CONF}" /etc/telegraf/telegraf.conf
bashio::log.info "Finished updating config, Starting Telegraf"
telegraf