# syntax=docker/dockerfile:1 ARG MAJOR_VERSION=5.0 ARG ZBX_VERSION=${MAJOR_VERSION}.16 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 LABEL name="zabbix/zabbix-build-sqlite3-50" \ maintainer="alexey.pustovalov@zabbix.com" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ release="${RELEASE}" \ summary="Zabbix build base (SQLite3)" \ description="Zabbix build base for SQLite3 based images" \ url="https://www.zabbix.com/" \ 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" \ org.label-schema.name="zabbix-build-sqlite3-rhel" \ org.label-schema.vendor="Zabbix LLC" \ org.label-schema.url="https://zabbix.com/" \ org.label-schema.description="Zabbix build base for SQLite3 based images" \ org.label-schema.vcs-ref="${VCS_REF}" RUN set -eux && \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${ZBX_VERSION} --depth 1 --single-branch /tmp/zabbix-${ZBX_VERSION} && \ 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 && \ export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ ./configure \ --datadir=/usr/lib \ --libdir=/usr/lib/zabbix \ --prefix=/usr \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ --enable-proxy \ --with-sqlite3 \ --with-ldap \ --with-libcurl \ --with-libxml2 \ --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --with-ssh \ --with-unixodbc \ --enable-ipv6 \ --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