2021-09-13 00:06:51 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
ARG MAJOR_VERSION=6.0
|
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
|
|
|
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION}
|
|
|
|
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
|
|
|
|
|
|
|
FROM ${BUILD_BASE_IMAGE} as builder
|
|
|
|
|
2020-08-06 22:22:01 +02:00
|
|
|
FROM ubuntu:focal
|
2018-02-18 21:42:44 +01:00
|
|
|
|
2021-09-13 00:06:51 +02:00
|
|
|
ARG MAJOR_VERSION
|
|
|
|
ARG ZBX_VERSION
|
|
|
|
ARG ZBX_SOURCES
|
|
|
|
|
|
|
|
ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
|
|
|
|
|
2020-04-28 18:39:39 +02:00
|
|
|
LABEL org.opencontainers.image.title="Zabbix Java Gateway" \
|
|
|
|
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 Java Gateway performs native support for monitoring JMX applications" \
|
2021-09-13 00:06:51 +02:00
|
|
|
org.opencontainers.image.licenses="GPL v2.0" \
|
|
|
|
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
|
|
|
|
org.opencontainers.image.version="${ZBX_VERSION}" \
|
|
|
|
org.opencontainers.image.source="${ZBX_SOURCES}"
|
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
|
2021-09-13 00:06:51 +02:00
|
|
|
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/bin", "/usr/sbin/zabbix_java/bin"]
|
|
|
|
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib", "/usr/sbin/zabbix_java/lib"]
|
|
|
|
|
2019-05-30 20:21:16 +02:00
|
|
|
RUN set -eux && \
|
2020-12-30 22:57:53 +01:00
|
|
|
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
|
2020-12-19 17:42:48 +01:00
|
|
|
groupadd --system --gid 1995 zabbix && \
|
|
|
|
useradd \
|
|
|
|
--system --comment "Zabbix monitoring system" \
|
|
|
|
-g zabbix -G root \
|
2020-04-28 18:39:39 +02:00
|
|
|
--uid 1997 \
|
2020-12-19 17:42:48 +01:00
|
|
|
--shell /sbin/nologin \
|
|
|
|
--home-dir /var/lib/zabbix/ \
|
2016-08-03 10:09:49 +02:00
|
|
|
zabbix && \
|
|
|
|
mkdir -p /etc/zabbix/ && \
|
2020-09-05 16:11:43 +02:00
|
|
|
mkdir -p /usr/sbin/zabbix_java/ && \
|
|
|
|
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
|
2020-04-28 18:39:39 +02:00
|
|
|
apt-get -y update && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
|
2018-07-19 12:37:11 +02:00
|
|
|
openjdk-8-jre-headless && \
|
2021-09-13 17:44:52 +02:00
|
|
|
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
|
|
|
|
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \
|
2020-04-28 18:39:39 +02:00
|
|
|
apt-get -y autoremove && \
|
|
|
|
apt-get -y clean && \
|
|
|
|
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \
|
|
|
|
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \
|
|
|
|
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ && \
|
2019-05-10 16:11:07 +02:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2016-08-03 10:09:49 +02:00
|
|
|
|
|
|
|
EXPOSE 10052/TCP
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
WORKDIR /var/lib/zabbix
|
2016-08-03 10:09:49 +02:00
|
|
|
|
2019-01-13 02:11:11 +01:00
|
|
|
VOLUME ["/usr/sbin/zabbix_java/ext_lib"]
|
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
|
|
|
|
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2020-04-28 18:39:39 +02:00
|
|
|
USER 1997
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2020-04-28 18:39:39 +02:00
|
|
|
CMD ["/usr/sbin/zabbix_java_gateway"]
|