zabbix-docker/Dockerfiles/snmptraps/alpine/Dockerfile

66 lines
2.3 KiB
Docker
Raw Normal View History

2024-05-23 08:27:12 +02:00
FROM alpine:3.20
2022-07-05 14:46:20 +02:00
ARG MAJOR_VERSION=6.4
2024-07-15 15:49:53 +02:00
ARG ZBX_VERSION=${MAJOR_VERSION}.17
2019-05-10 16:11:07 +02:00
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
2021-10-16 17:49:19 +02:00
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
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="\n" \
ZBX_SNMP_TRAP_USE_DNS=false
2021-10-16 17:49:19 +02:00
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix SNMP traps receiver" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
2021-10-16 17:49:19 +02:00
org.opencontainers.image.licenses="GPL v2.0" \
org.opencontainers.image.title="zabbix-snmptraps" \
org.opencontainers.image.url="https://zabbix.com/" \
2024-05-21 12:45:53 +02:00
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
2019-05-30 20:21:16 +02:00
RUN set -eux && \
2021-10-16 17:49:19 +02:00
INSTALL_PKGS="bash \
tzdata \
net-snmp" && \
apk add \
--no-cache \
--clean-protected \
${INSTALL_PKGS} && \
addgroup \
--system \
--gid 1995 \
zabbix && \
adduser \
--system \
--gecos "Zabbix monitoring system" \
--disabled-password \
--uid 1997 \
--ingroup zabbix \
--shell /sbin/nologin \
--home /var/lib/zabbix/ \
zabbix && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \
2021-10-16 17:49:19 +02:00
touch /var/lib/net-snmp/snmptrapd.conf && \
2020-04-25 22:24:26 +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/
2020-04-25 22:24:26 +02:00
EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/
2020-07-13 23:43:32 +02:00
VOLUME ["/var/lib/zabbix/snmptraps"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]
COPY ["conf/usr/sbin/zabbix_trap_handler.sh", "/usr/sbin/"]
2020-04-25 19:31:44 +02:00
USER 1997
2024-06-21 06:46:09 +02:00
CMD ["/usr/sbin/snmptrapd", "-n", "-t", "-X", "-C", "-c", "/etc/snmp/snmptrapd.conf", "-Lo", "-A", "--doNotFork=yes", "--agentuser=zabbix"]