2018-07-19 12:37:11 +02:00
|
|
|
FROM ubuntu:bionic
|
2017-04-27 18:32:34 +02:00
|
|
|
LABEL maintainer "Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
2016-08-03 14:23:39 +02:00
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
|
|
|
|
2018-05-31 09:50:32 +02:00
|
|
|
ARG APT_FLAGS_COMMON="-y"
|
|
|
|
ARG APT_FLAGS_PERSISTENT="${APT_FLAGS_COMMON} --no-install-recommends"
|
2016-08-03 14:23:39 +02:00
|
|
|
ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
|
2018-02-18 21:42:44 +01:00
|
|
|
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm \
|
|
|
|
MIBDIRS=/var/lib/mibs/iana:/var/lib/mibs/ietf:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
|
|
|
|
|
|
|
|
LABEL org.label-schema.name="zabbix-snmptraps-ubuntu" \
|
|
|
|
org.label-schema.vendor="Zabbix LLC" \
|
|
|
|
org.label-schema.url="https://zabbix.com/" \
|
|
|
|
org.label-schema.description="Zabbix SNMP traps receiver" \
|
|
|
|
org.label-schema.vcs-ref="${VCS_REF}" \
|
|
|
|
org.label-schema.build-date="${BUILD_DATE}" \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
2018-05-31 09:50:32 +02:00
|
|
|
org.label-schema.license="GPL v2.0"
|
2018-02-18 21:42:44 +01:00
|
|
|
|
2018-05-10 22:30:42 +02:00
|
|
|
ARG MAJOR_VERSION=master
|
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
2018-02-18 21:42:44 +01:00
|
|
|
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
|
|
|
|
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
|
|
|
|
|
|
|
|
LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
|
|
|
|
org.label-schema.version="1.14" \
|
|
|
|
org.label-schema.vcs-url="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" \
|
|
|
|
org.label-schema.docker.cmd="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:162/UDP -d zabbix-snmptraps:ubuntu-${ZBX_VERSION}"
|
|
|
|
|
|
|
|
STOPSIGNAL SIGTERM
|
2016-08-03 14:23:39 +02:00
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
COPY ["snmptrapfmt_1.14+nmu1ubuntu2_amd64.deb", "/tmp/"]
|
2016-08-11 12:55:45 +02:00
|
|
|
|
2018-07-19 12:37:11 +02:00
|
|
|
RUN apt-get ${APT_FLAGS_COMMON} update && \
|
|
|
|
apt-get ${APT_FLAGS_PERSISTENT} install locales && \
|
|
|
|
locale-gen $LC_ALL && \
|
2016-08-03 14:23:39 +02:00
|
|
|
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
|
|
|
|
addgroup --system --quiet zabbix && \
|
|
|
|
adduser --quiet \
|
|
|
|
--system --disabled-login \
|
|
|
|
--ingroup zabbix \
|
|
|
|
--home /var/lib/zabbix/ \
|
|
|
|
zabbix && \
|
|
|
|
apt-get ${APT_FLAGS_COMMON} update && \
|
2018-05-31 09:50:32 +02:00
|
|
|
apt-get ${APT_FLAGS_PERSISTENT} install \
|
2018-02-18 21:42:44 +01:00
|
|
|
snmp-mibs-downloader \
|
2016-08-03 14:23:39 +02:00
|
|
|
snmpd \
|
2018-05-31 09:50:32 +02:00
|
|
|
supervisor && \
|
|
|
|
download-mibs && \
|
2016-08-11 12:55:45 +02:00
|
|
|
dpkg -i /tmp/snmptrapfmt_1.14+nmu1ubuntu2_amd64.deb && \
|
2016-08-03 14:23:39 +02:00
|
|
|
mkdir -p /var/lib/zabbix && \
|
|
|
|
mkdir -p /var/lib/zabbix/snmptraps && \
|
|
|
|
mkdir -p /var/lib/zabbix/mibs && \
|
|
|
|
chown --quiet -R zabbix:root /var/lib/zabbix && \
|
|
|
|
echo "disableAuthorization yes" >> "/etc/snmp/snmptrapd.conf" && \
|
|
|
|
echo "traphandle default /usr/sbin/snmptrapfmthdlr" >> "/etc/snmp/snmptrapd.conf" && \
|
|
|
|
sed -i \
|
|
|
|
-e "/^VARFMT=/s/=.*/=\"%n %v \"/" \
|
|
|
|
-e '/^LOGFMT=/s/=.*/=\"$x ZBXTRAP $R $G $S $e $*\"/' \
|
|
|
|
-e "/^LOGFILE=/s/=.*/=\"\/var\/lib\/zabbix\/snmptraps\/snmptraps.log\"/" \
|
|
|
|
"/etc/snmp/snmptrapfmt.conf" && \
|
2016-08-11 12:55:45 +02:00
|
|
|
rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2_amd64.deb && \
|
2018-02-18 21:42:44 +01:00
|
|
|
apt-get ${APT_FLAGS_COMMON} purge \
|
|
|
|
snmp-mibs-downloader \
|
2018-05-31 09:50:32 +02:00
|
|
|
wget && \
|
2018-02-18 21:42:44 +01:00
|
|
|
apt-get ${APT_FLAGS_COMMON} autoremove 1>/dev/null && \
|
2016-08-03 14:23:39 +02:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
EXPOSE 162/UDP
|
|
|
|
|
|
|
|
WORKDIR /var/lib/zabbix/snmptraps/
|
|
|
|
|
2016-08-04 07:53:22 +02:00
|
|
|
VOLUME ["/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
2016-08-03 14:23:39 +02:00
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
COPY ["conf/etc/supervisor/", "/etc/supervisor/"]
|
|
|
|
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
|
2016-08-03 14:23:39 +02:00
|
|
|
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|