53 lines
1.8 KiB
Docker
Executable File
53 lines
1.8 KiB
Docker
Executable File
ARG BUILD_FROM
|
|
FROM ${BUILD_FROM}
|
|
|
|
# Set shell
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
# Setup base system
|
|
ARG BUILD_ARCH=amd64
|
|
|
|
# Install syslog-ng
|
|
RUN \
|
|
apt-get update -qq && \
|
|
apt-get install -y wget ca-certificates gnupg2 debian-ports-archive-keyring xz-utils dirmngr systemd && \
|
|
wget -qO - https://ose-repo.syslog-ng.com/apt/syslog-ng-ose-pub.asc | gpg --dearmor > /usr/share/keyrings/ose-repo-archive-keyring.gpg && \
|
|
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 && \
|
|
apt-get update -qq && \
|
|
apt-get install -y libdbd-mysql libdbd-pgsql libdbd-sqlite3 syslog-ng && \
|
|
rm -fr /tmp/* /var/{cache,log}/* /var/lib/apt/lists/*
|
|
|
|
# Copy root filesystem
|
|
COPY rootfs /
|
|
|
|
# Expose ports
|
|
EXPOSE 514/udp 601/tcp 6514/tcp
|
|
|
|
# Define HealthCheck
|
|
HEALTHCHECK --interval=2m --timeout=3s --start-period=30s CMD /usr/sbin/syslog-ng-ctl stats || exit 1
|
|
|
|
# Build arguments
|
|
ARG BUILD_ARCH
|
|
ARG BUILD_DATE
|
|
ARG BUILD_DESCRIPTION
|
|
ARG BUILD_NAME
|
|
ARG BUILD_REF
|
|
ARG BUILD_REPOSITORY
|
|
ARG BUILD_VERSION
|
|
|
|
# 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} |