2021-09-13 03:35:17 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
2023-03-07 09:07:13 +01:00
|
|
|
ARG MAJOR_VERSION=7.0
|
2021-09-13 03:35:17 +02:00
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
|
|
|
ARG BUILD_BASE_IMAGE=zabbix-build-base:ol-${ZBX_VERSION}
|
|
|
|
|
|
|
|
FROM ${BUILD_BASE_IMAGE} as builder
|
|
|
|
|
|
|
|
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
|
2023-12-15 14:38:54 +01:00
|
|
|
ARG GIT_BRANCH=master
|
2021-09-13 03:35:17 +02:00
|
|
|
|
2021-10-16 17:49:19 +02:00
|
|
|
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
2021-09-13 03:35:17 +02:00
|
|
|
org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \
|
|
|
|
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 build base (SQLite3)" \
|
|
|
|
org.opencontainers.image.url="https://zabbix.com/" \
|
|
|
|
org.opencontainers.image.vendor="Zabbix LLC" \
|
|
|
|
org.opencontainers.image.version="${ZBX_VERSION}"
|
2021-09-13 03:35:17 +02:00
|
|
|
|
2023-01-20 08:47:40 +01:00
|
|
|
ENV MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=master \
|
|
|
|
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=master
|
|
|
|
|
2021-09-13 03:35:17 +02:00
|
|
|
RUN set -eux && \
|
|
|
|
cd /tmp/ && \
|
2023-12-15 14:38:54 +01:00
|
|
|
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH} --depth 1 --single-branch /tmp/zabbix-${ZBX_VERSION} && \
|
2021-09-13 03:35:17 +02:00
|
|
|
cd /tmp/zabbix-${ZBX_VERSION} && \
|
|
|
|
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-09-13 03:35:17 +02:00
|
|
|
./configure \
|
|
|
|
--datadir=/usr/lib \
|
|
|
|
--libdir=/usr/lib/zabbix \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc/zabbix \
|
|
|
|
--enable-agent \
|
|
|
|
--enable-agent2 \
|
2021-10-16 17:49:19 +02:00
|
|
|
--enable-ipv6 \
|
|
|
|
--enable-java \
|
2021-09-13 03:35:17 +02:00
|
|
|
--enable-proxy \
|
|
|
|
--with-ldap \
|
|
|
|
--with-libcurl \
|
2021-10-16 17:49:19 +02:00
|
|
|
# --with-libmodbus \
|
2022-01-22 13:44:37 +01:00
|
|
|
--with-libpcre2 \
|
2021-09-13 03:35:17 +02:00
|
|
|
--with-libxml2 \
|
|
|
|
--with-net-snmp \
|
|
|
|
--with-openipmi \
|
|
|
|
--with-openssl \
|
2021-10-16 17:49:19 +02:00
|
|
|
--with-sqlite3 \
|
2021-09-13 03:35:17 +02:00
|
|
|
--with-ssh \
|
|
|
|
--with-unixodbc \
|
|
|
|
--silent && \
|
|
|
|
make -j"$(nproc)" -s dbschema && \
|
|
|
|
make -j"$(nproc)" -s && \
|
2023-03-14 13:15:10 +01:00
|
|
|
mkdir /tmp/fonts/ && \
|
|
|
|
curl --silent -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
|
|
|
|
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-09-13 03:35:17 +02:00
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_agent/zabbix_agentd && \
|
|
|
|
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 && \
|
2022-12-13 19:01:46 +01:00
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender && \
|
2023-01-20 08:47:40 +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 && \
|
|
|
|
strip /tmp/postgresql_plugin/zabbix-agent2-plugin-postgresql && \
|
2022-12-13 19:01:46 +01:00
|
|
|
rm -rf $(go env GOCACHE)
|