2020-04-26 18:45:42 +02:00
|
|
|
FROM centos:centos7
|
|
|
|
|
|
|
|
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" \
|
|
|
|
org.opencontainers.image.licenses="GPL v2.0"
|
|
|
|
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
|
|
|
|
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/ \
|
2020-04-26 18:45:42 +02:00
|
|
|
zabbix && \
|
|
|
|
mkdir -p /etc/zabbix/ && \
|
|
|
|
mkdir -p /usr/sbin/zabbix_java/ && \
|
2020-09-05 16:11:43 +02:00
|
|
|
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
|
2020-04-26 18:45:42 +02:00
|
|
|
yum --quiet makecache && \
|
|
|
|
yum -y install --setopt=tsflags=nodocs \
|
|
|
|
java-1.8.0-openjdk-headless && \
|
|
|
|
yum -y clean all && \
|
|
|
|
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
|
|
|
|
rm -rf /etc/udev/hwdb.bin /root/.pki
|
2018-05-26 12:58:52 +02:00
|
|
|
|
|
|
|
ARG MAJOR_VERSION=master
|
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
2019-05-10 16:11:07 +02:00
|
|
|
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
2020-04-26 18:45:42 +02:00
|
|
|
|
|
|
|
ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
|
|
|
|
|
|
|
|
LABEL 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-05-26 12:58:52 +02:00
|
|
|
|
2020-04-27 17:27:35 +02:00
|
|
|
COPY ["conf/etc/", "/etc/"]
|
|
|
|
|
2019-05-30 20:21:16 +02:00
|
|
|
RUN set -eux && \
|
2020-04-26 18:45:42 +02:00
|
|
|
yum --quiet makecache && \
|
2020-04-27 16:05:27 +02:00
|
|
|
yum -y install --setopt=tsflags=nodocs \
|
2018-05-26 12:58:52 +02:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
java-1.8.0-openjdk-devel \
|
|
|
|
make \
|
2019-05-10 16:11:07 +02:00
|
|
|
git \
|
2018-05-26 12:58:52 +02:00
|
|
|
gcc && \
|
|
|
|
cd /tmp/ && \
|
2021-06-10 19:56:15 +02:00
|
|
|
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${ZBX_VERSION} --depth 1 --single-branch zabbix-${ZBX_VERSION} && \
|
2018-05-26 12:58:52 +02:00
|
|
|
cd /tmp/zabbix-${ZBX_VERSION} && \
|
2019-05-10 16:11:07 +02:00
|
|
|
zabbix_revision=`git rev-parse --short HEAD` && \
|
2018-05-26 12:58:52 +02:00
|
|
|
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
|
|
|
|
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
|
2018-05-31 09:50:32 +02:00
|
|
|
./bootstrap.sh && \
|
2018-05-26 12:58:52 +02:00
|
|
|
./configure \
|
|
|
|
--datadir=/usr/lib \
|
|
|
|
--libdir=/usr/lib/zabbix \
|
|
|
|
--sysconfdir=/etc/zabbix \
|
|
|
|
--prefix=/usr \
|
|
|
|
--enable-java \
|
|
|
|
--silent && \
|
2018-05-31 09:50:32 +02:00
|
|
|
make -j"$(nproc)" -s && \
|
2018-05-26 12:58:52 +02:00
|
|
|
mkdir -p /usr/sbin/zabbix_java/ && \
|
2020-04-26 18:45:42 +02:00
|
|
|
cp -r src/zabbix_java/bin /usr/sbin/zabbix_java/ && \
|
|
|
|
cp -r src/zabbix_java/lib /usr/sbin/zabbix_java/ && \
|
|
|
|
rm -rf /usr/sbin/zabbix_java/lib/*.xml && \
|
|
|
|
cd /tmp/ && \
|
|
|
|
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
|
|
|
|
yum -y history undo `yum -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
|
|
|
|
yum -y clean all && \
|
2020-04-27 17:27:35 +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/ && \
|
2020-04-26 18:45:42 +02:00
|
|
|
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
|
|
|
|
rm -rf /etc/udev/hwdb.bin /root/.pki
|
2018-02-18 21:45:33 +01:00
|
|
|
|
|
|
|
EXPOSE 10052/TCP
|
|
|
|
|
|
|
|
WORKDIR /var/lib/zabbix
|
|
|
|
|
|
|
|
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
|
|
|
|
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
|
|
|
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
2020-04-26 18:45:42 +02:00
|
|
|
|
|
|
|
USER 1997
|
|
|
|
|
|
|
|
CMD ["/usr/sbin/zabbix_java_gateway"]
|