2020-12-19 18:20:40 +01:00
|
|
|
FROM centos:centos8
|
2018-05-31 09:50:32 +02:00
|
|
|
|
2020-10-27 22:40:47 +01:00
|
|
|
ARG MAJOR_VERSION=5.4
|
2018-05-26 12:58:52 +02:00
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
2019-05-10 16:11:07 +02:00
|
|
|
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
2018-05-10 22:30:42 +02:00
|
|
|
|
2020-04-26 18:45:42 +02:00
|
|
|
ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
2021-02-09 01:58:31 +01:00
|
|
|
MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \
|
|
|
|
ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT=" "
|
2020-04-26 18:45:42 +02:00
|
|
|
|
|
|
|
LABEL org.opencontainers.image.title="zabbix-snmptraps-centos" \
|
|
|
|
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
|
|
|
org.opencontainers.image.vendor="Zabbix LLC" \
|
|
|
|
org.opencontainers.image.url="https://zabbix.com/" \
|
|
|
|
org.opencontainers.image.description="Zabbix SNMP traps receiver" \
|
|
|
|
org.opencontainers.image.licenses="GPL v2.0" \
|
|
|
|
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
|
2020-12-18 13:13:28 +01:00
|
|
|
org.opencontainers.image.version="${ZBX_VERSION}"
|
2018-05-10 22:30:42 +02:00
|
|
|
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
|
2019-05-30 20:21:16 +02:00
|
|
|
RUN set -eux && \
|
2020-12-19 17:42:48 +01:00
|
|
|
groupadd --system --gid 1995 zabbix && \
|
|
|
|
useradd \
|
|
|
|
--system --comment "Zabbix monitoring system" \
|
2020-04-26 18:45:42 +02:00
|
|
|
-g zabbix -G root \
|
2020-12-19 17:42:48 +01:00
|
|
|
--uid 1997 \
|
|
|
|
--shell /sbin/nologin \
|
|
|
|
--home-dir /var/lib/zabbix/ \
|
2018-05-10 22:30:42 +02:00
|
|
|
zabbix && \
|
2020-04-26 18:45:42 +02:00
|
|
|
yum --quiet makecache && \
|
|
|
|
yum -y install epel-release && \
|
|
|
|
yum -y install --setopt=tsflags=nodocs \
|
2020-08-28 18:50:40 +02:00
|
|
|
tzdata \
|
2020-12-18 13:13:28 +01:00
|
|
|
net-snmp && \
|
2018-05-10 22:30:42 +02:00
|
|
|
mkdir -p /var/lib/zabbix && \
|
|
|
|
mkdir -p /var/lib/zabbix/snmptraps && \
|
|
|
|
mkdir -p /var/lib/zabbix/mibs && \
|
2021-02-09 01:58:31 +01:00
|
|
|
touch /var/lib/net-snmp/snmptrapd.conf && \
|
2020-04-26 18:45:42 +02:00
|
|
|
chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
|
|
|
|
chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
|
|
|
|
chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
|
|
|
|
yum -y clean all && \
|
|
|
|
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
|
|
|
|
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
|
|
|
|
|
|
|
|
EXPOSE 1162/UDP
|
2018-05-10 22:30:42 +02:00
|
|
|
|
|
|
|
WORKDIR /var/lib/zabbix/snmptraps/
|
|
|
|
|
2020-07-13 23:43:32 +02:00
|
|
|
VOLUME ["/var/lib/zabbix/snmptraps"]
|
2018-05-10 22:30:42 +02:00
|
|
|
|
|
|
|
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
|
2020-12-18 13:13:28 +01:00
|
|
|
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]
|
2021-02-09 01:58:31 +01:00
|
|
|
COPY ["conf/usr/sbin/zabbix_trap_handler.sh", "/usr/sbin/"]
|
2018-05-10 22:30:42 +02:00
|
|
|
|
2020-04-26 18:45:42 +02:00
|
|
|
USER 1997
|
|
|
|
|
2020-12-18 13:13:28 +01:00
|
|
|
CMD ["/usr/sbin/snmptrapd", "-n", "-C", "-c", "/etc/snmp/snmptrapd.conf", "-Lo", "-A"]
|