2021-09-13 00:06:51 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
2022-07-05 14:46:20 +02:00
|
|
|
ARG MAJOR_VERSION=6.4
|
2024-11-20 08:42:05 +01:00
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}.20
|
2021-09-13 00:06:51 +02:00
|
|
|
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION}
|
|
|
|
|
2024-02-13 17:07:53 +01:00
|
|
|
FROM ${BUILD_BASE_IMAGE} AS builder
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2022-05-08 21:28:05 +02:00
|
|
|
FROM ubuntu:jammy
|
2018-02-18 21:42:44 +01:00
|
|
|
|
2021-09-13 00:06:51 +02:00
|
|
|
ARG MAJOR_VERSION
|
|
|
|
ARG ZBX_VERSION
|
2021-10-16 17:49:19 +02:00
|
|
|
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2021-10-16 17:49:19 +02:00
|
|
|
ENV TERM=xterm \
|
|
|
|
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2021-10-16 17:49:19 +02:00
|
|
|
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
2020-04-28 18:39:39 +02:00
|
|
|
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.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.source="${ZBX_SOURCES}" \
|
|
|
|
org.opencontainers.image.title="Zabbix Java Gateway" \
|
|
|
|
org.opencontainers.image.url="https://zabbix.com/" \
|
2024-05-21 12:45:53 +02:00
|
|
|
org.opencontainers.image.vendor="Zabbix SIA" \
|
2021-10-16 17:49:19 +02:00
|
|
|
org.opencontainers.image.version="${ZBX_VERSION}"
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2018-02-18 21:42:44 +01:00
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
|
2024-06-01 08:10:31 +02:00
|
|
|
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/java_gateway/sbin/", "/usr/sbin/zabbix_java/"]
|
2021-09-13 00:06:51 +02:00
|
|
|
|
2024-02-18 15:27:03 +01:00
|
|
|
RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
|
|
|
|
set -eux && \
|
2020-12-30 22:57:53 +01:00
|
|
|
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
|
2021-10-16 17:49:19 +02:00
|
|
|
INSTALL_PKGS="bash \
|
2023-09-20 11:13:10 +02:00
|
|
|
openjdk-17-jre-headless" && \
|
2021-10-16 17:49:19 +02:00
|
|
|
apt-get -y update && \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get -y \
|
|
|
|
--no-install-recommends install \
|
|
|
|
${INSTALL_PKGS} && \
|
|
|
|
groupadd \
|
|
|
|
--system \
|
|
|
|
--gid 1995 \
|
|
|
|
zabbix && \
|
2020-12-19 17:42:48 +01:00
|
|
|
useradd \
|
2021-10-16 17:49:19 +02:00
|
|
|
--system \
|
|
|
|
--comment "Zabbix monitoring system" \
|
|
|
|
-g zabbix \
|
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/ && \
|
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
|
|
|
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/ && \
|
2021-10-16 17:49:19 +02:00
|
|
|
apt-get -y autoremove && \
|
2024-02-18 15:27:03 +01:00
|
|
|
apt-get -y clean
|
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
|
|
|
|
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"]
|