2021-10-15 21:55:46 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
ARG MAJOR_VERSION=6.0
|
2022-11-28 16:05:58 +01:00
|
|
|
ARG RELEASE=11
|
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}.11
|
2021-10-15 21:55:46 +02:00
|
|
|
ARG BUILD_BASE_IMAGE=zabbix-build-base:rhel-${ZBX_VERSION}
|
|
|
|
|
|
|
|
FROM ${BUILD_BASE_IMAGE} as builder
|
|
|
|
|
|
|
|
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 SQLite3 based images" \
|
2021-10-15 21:55:46 +02:00
|
|
|
maintainer="alexey.pustovalov@zabbix.com" \
|
2022-02-15 11:11:35 +01:00
|
|
|
name="zabbix/zabbix-build-sqlite3-60" \
|
2021-10-15 21:55:46 +02:00
|
|
|
release="${RELEASE}" \
|
|
|
|
summary="Zabbix build base (SQLite3)" \
|
|
|
|
url="https://www.zabbix.com/" \
|
2021-10-16 17:49:19 +02:00
|
|
|
vendor="Zabbix LLC" \
|
|
|
|
version="${MAJOR_VERSION}" \
|
2021-10-15 21:55:46 +02:00
|
|
|
io.k8s.description="Zabbix build base for SQLite3 based images" \
|
|
|
|
io.k8s.display-name="Zabbix build base (SQLite3)" \
|
|
|
|
io.openshift.expose-services="" \
|
|
|
|
io.openshift.tags="zabbix,build,sqlite3" \
|
2021-10-16 17:49:19 +02:00
|
|
|
org.label-schema.description="Zabbix build base for SQLite3 based images" \
|
2021-10-15 21:55:46 +02:00
|
|
|
org.label-schema.name="zabbix-build-sqlite3-rhel" \
|
|
|
|
org.label-schema.url="https://zabbix.com/" \
|
2021-10-16 17:49:19 +02:00
|
|
|
org.label-schema.vcs-ref="${VCS_REF}" \
|
|
|
|
org.label-schema.vendor="Zabbix LLC"
|
2021-10-15 21:55:46 +02:00
|
|
|
|
|
|
|
RUN set -eux && \
|
2021-10-29 18:11:31 +02:00
|
|
|
ARCH_SUFFIX="$(arch)"; \
|
|
|
|
case "$ARCH_SUFFIX" in \
|
|
|
|
x86_64) \
|
|
|
|
additional_components='--enable-java'; \
|
|
|
|
;; \
|
|
|
|
aarch64) \
|
|
|
|
additional_components='--enable-java'; \
|
|
|
|
;; \
|
|
|
|
ppc64le) \
|
|
|
|
additional_components=''; \
|
|
|
|
;; \
|
|
|
|
*) echo "Unknown ARCH_SUFFIX=${ARCH_SUFFIX-}"; exit 1 ;; \
|
|
|
|
esac; \
|
2021-10-15 21:55:46 +02:00
|
|
|
cd /tmp/ && \
|
2022-02-15 11:00:22 +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} && \
|
|
|
|
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 \
|
|
|
|
--enable-agent \
|
|
|
|
--enable-agent2 \
|
2021-10-16 17:49:19 +02:00
|
|
|
--enable-ipv6 \
|
2021-10-15 21:55:46 +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-10-15 21:55:46 +02:00
|
|
|
--with-libxml2 \
|
|
|
|
--with-net-snmp \
|
|
|
|
--with-openipmi \
|
|
|
|
--with-openssl \
|
2021-10-16 17:49:19 +02:00
|
|
|
--with-sqlite3 \
|
2021-10-15 21:55:46 +02:00
|
|
|
--with-ssh \
|
|
|
|
--with-unixodbc \
|
2021-10-29 18:11:31 +02:00
|
|
|
$additional_components \
|
2021-10-15 21:55:46 +02:00
|
|
|
--silent && \
|
|
|
|
make -j"$(nproc)" -s dbschema && \
|
|
|
|
make -j"$(nproc)" -s && \
|
|
|
|
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 && \
|
|
|
|
strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender
|