2021-10-15 21:55:46 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
2022-07-05 14:46:20 +02:00
|
|
|
ARG MAJOR_VERSION=6.4
|
2024-05-21 13:15:08 +02:00
|
|
|
ARG RELEASE=15
|
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}.15
|
2021-10-15 21:55:46 +02:00
|
|
|
ARG BUILD_BASE_IMAGE=zabbix-build-base:rhel-${ZBX_VERSION}
|
|
|
|
|
2024-02-13 17:07:53 +01:00
|
|
|
FROM ${BUILD_BASE_IMAGE} AS builder
|
2021-10-15 21:55:46 +02:00
|
|
|
|
|
|
|
ARG MAJOR_VERSION
|
|
|
|
ARG RELEASE
|
|
|
|
ARG ZBX_VERSION
|
|
|
|
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
|
|
|
|
2021-10-16 17:49:19 +02:00
|
|
|
LABEL description="Zabbix build base for MySQL based images" \
|
2021-10-15 21:55:46 +02:00
|
|
|
maintainer="alexey.pustovalov@zabbix.com" \
|
2023-03-07 08:49:55 +01:00
|
|
|
name="zabbix/zabbix-build-mysql-64" \
|
2021-10-15 21:55:46 +02:00
|
|
|
release="${RELEASE}" \
|
|
|
|
summary="Zabbix build base (MySQL)" \
|
|
|
|
url="https://www.zabbix.com/" \
|
2024-05-21 12:45:53 +02:00
|
|
|
vendor="Zabbix SIA" \
|
2021-10-16 17:49:19 +02:00
|
|
|
version="${MAJOR_VERSION}" \
|
2021-10-15 21:55:46 +02:00
|
|
|
io.k8s.description="Zabbix build base for MySQL based images" \
|
|
|
|
io.k8s.display-name="Zabbix build base (MySQL)" \
|
|
|
|
io.openshift.expose-services="" \
|
|
|
|
io.openshift.tags="zabbix,build,mysql" \
|
2021-10-16 17:49:19 +02:00
|
|
|
org.label-schema.description="Zabbix build base for MySQL based images" \
|
2021-10-15 21:55:46 +02:00
|
|
|
org.label-schema.name="zabbix-build-mysql-rhel" \
|
|
|
|
org.label-schema.url="https://zabbix.com/" \
|
2021-10-16 17:49:19 +02:00
|
|
|
org.label-schema.vcs-ref="${VCS_REF}" \
|
2024-05-21 12:45:53 +02:00
|
|
|
org.label-schema.vendor="Zabbix SIA"
|
2021-10-15 21:55:46 +02:00
|
|
|
|
2023-03-07 08:49:55 +01:00
|
|
|
ENV MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_VERSION} \
|
|
|
|
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_VERSION}
|
2022-12-14 08:33:01 +01:00
|
|
|
|
2024-02-18 13:52:23 +01:00
|
|
|
RUN --mount=type=cache,target=/root/.cache/go-build/ \
|
|
|
|
--mount=type=cache,target=/root/go/ \
|
|
|
|
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
|
|
|
set -eux && \
|
2021-10-15 21:55:46 +02:00
|
|
|
cd /tmp/ && \
|
2023-03-07 08:49:55 +01:00
|
|
|
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${ZBX_VERSION} --depth 1 --single-branch /tmp/zabbix-${ZBX_VERSION} && \
|
2021-10-15 21:55:46 +02:00
|
|
|
cd /tmp/zabbix-${ZBX_VERSION} && \
|
2023-01-20 08:30:08 +01:00
|
|
|
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
|
2021-10-15 21:55:46 +02:00
|
|
|
zabbix_revision=`git rev-parse --short HEAD` && \
|
|
|
|
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
|
|
|
|
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
|
|
|
|
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
|
|
|
|
./bootstrap.sh && \
|
2022-07-20 14:33:17 +02:00
|
|
|
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
|
|
|
|
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
|
2021-10-15 21:55:46 +02:00
|
|
|
./configure \
|
|
|
|
--datadir=/usr/lib \
|
|
|
|
--libdir=/usr/lib/zabbix \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc/zabbix \
|
2021-10-16 17:49:19 +02:00
|
|
|
--enable-ipv6 \
|
2021-10-15 21:55:46 +02:00
|
|
|
--enable-agent \
|
|
|
|
--enable-agent2 \
|
|
|
|
--enable-proxy \
|
2021-10-16 17:49:19 +02:00
|
|
|
--enable-server \
|
2021-10-15 21:55:46 +02:00
|
|
|
--enable-webservice \
|
|
|
|
--with-ldap \
|
|
|
|
--with-libcurl \
|
2024-02-09 19:34:39 +01:00
|
|
|
--with-libmodbus \
|
2022-01-22 13:44:37 +01:00
|
|
|
--with-libpcre2 \
|
2021-10-15 21:55:46 +02:00
|
|
|
--with-libxml2 \
|
2021-10-16 17:49:19 +02:00
|
|
|
--with-mysql \
|
2021-10-15 21:55:46 +02:00
|
|
|
--with-net-snmp \
|
|
|
|
--with-openipmi \
|
|
|
|
--with-openssl \
|
|
|
|
--with-ssh \
|
|
|
|
--with-unixodbc \
|
2024-02-05 13:19:33 +01:00
|
|
|
--enable-java \
|
2021-10-15 21:55:46 +02:00
|
|
|
--silent && \
|
|
|
|
make -j"$(nproc)" -s dbschema && \
|
|
|
|
make -j"$(nproc)" -s && \
|
|
|
|
make -j"$(nproc)" -s gettext && \
|
|
|
|
cat database/mysql/schema.sql > database/mysql/create.sql && \
|
|
|
|
cat database/mysql/images.sql >> database/mysql/create.sql && \
|
|
|
|
cat database/mysql/data.sql >> database/mysql/create.sql && \
|
|
|
|
gzip -c database/mysql/create.sql > database/mysql/create_server.sql.gz && \
|
|
|
|
rm -rf database/mysql/create.sql && \
|
|
|
|
cat database/mysql/schema.sql > database/mysql/create.sql && \
|
|
|
|
gzip -c database/mysql/create.sql > database/mysql/create_proxy.sql.gz && \
|
|
|
|
rm -rf database/mysql/create.sql && \
|
2023-03-14 13:15:10 +01:00
|
|
|
mkdir /tmp/fonts/ && \
|
2024-02-16 06:19:02 +01:00
|
|
|
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
|
2023-03-14 13:15:10 +01:00
|
|
|
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
|
|
|
|
cp /tmp/fonts/NotoSansCJKjp-Regular.otf /tmp/zabbix-${ZBX_VERSION}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
|
|
|
|
cp /tmp/fonts/LICENSE_OFL.txt /tmp/zabbix-${ZBX_VERSION}/ui/assets/fonts/ && \
|
|
|
|
rm -f /tmp/zabbix-${ZBX_VERSION}/ui/assets/fonts/DejaVuSans.ttf && \
|
|
|
|
sed -i -r "s/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/" /tmp/zabbix-${ZBX_VERSION}/ui/include/defines.inc.php && \
|
|
|
|
rm -rf /tmp/fonts/ && \
|
2023-05-15 11:35:30 +02:00
|
|
|
chmod o+r /tmp/zabbix-${ZBX_VERSION}/ui/assets/fonts/* && \
|
2021-10-15 21:55:46 +02:00
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_agent/zabbix_agentd && \
|
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_server/zabbix_server && \
|
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_proxy/zabbix_proxy && \
|
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_agent2 && \
|
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get && \
|
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender && \
|
2022-12-13 19:01:46 +01:00
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_web_service && \
|
2022-12-14 08:33:01 +01:00
|
|
|
cd /tmp/ && \
|
|
|
|
git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb_plugin && \
|
|
|
|
cd /tmp/mongodb_plugin && \
|
|
|
|
make && \
|
|
|
|
strip /tmp/mongodb_plugin/zabbix-agent2-plugin-mongodb && \
|
|
|
|
cd /tmp/ && \
|
|
|
|
git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql_plugin && \
|
|
|
|
cd /tmp/postgresql_plugin && \
|
|
|
|
make && \
|
2024-02-18 13:52:23 +01:00
|
|
|
strip /tmp/postgresql_plugin/zabbix-agent2-plugin-postgresql
|