Skip to content

Commit

Permalink
Added build arg for CFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneft committed Aug 16, 2024
1 parent 66dc8bd commit e47229a
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 59 deletions.
8 changes: 4 additions & 4 deletions Dockerfiles/build-mysql/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -64,16 +66,15 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-ipv6 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
Expand All @@ -88,7 +89,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfiles/build-mysql/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -64,8 +66,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
Expand All @@ -74,6 +74,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
Expand All @@ -88,7 +89,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
14 changes: 8 additions & 6 deletions Dockerfiles/build-mysql/ol/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
Expand All @@ -22,10 +25,11 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}

RUN --mount=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
Expand Down Expand Up @@ -62,8 +66,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfiles/build-mysql/rhel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL description="Zabbix build base for MySQL based images" \
maintainer="alexey.pustovalov@zabbix.com" \
Expand All @@ -34,6 +35,7 @@ LABEL description="Zabbix build base for MySQL based images" \

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -74,8 +76,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
Expand All @@ -84,6 +84,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
Expand All @@ -98,7 +99,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfiles/build-mysql/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -64,8 +66,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
Expand All @@ -74,6 +74,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
Expand All @@ -88,7 +89,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
10 changes: 5 additions & 5 deletions Dockerfiles/build-pgsql/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=postgresql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -66,16 +68,15 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-ipv6 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
Expand All @@ -84,13 +85,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-${DB_TYPE} \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
7 changes: 3 additions & 4 deletions Dockerfiles/build-pgsql/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=postgresql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -66,8 +68,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
Expand All @@ -84,13 +84,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-${DB_TYPE} \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfiles/build-pgsql/ol/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=postgresql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -66,8 +68,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
Expand All @@ -85,10 +85,10 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-${DB_TYPE} \
--with-ssh \
--with-unixodbc \
--silent && \
Expand Down
9 changes: 4 additions & 5 deletions Dockerfiles/build-pgsql/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH

ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS

LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \
Expand All @@ -24,6 +25,7 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab

ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=postgresql \
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
Expand Down Expand Up @@ -66,16 +68,14 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
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,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-ipv6 \
--enable-proxy \
--enable-server \
--enable-webservice \
Expand All @@ -84,13 +84,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-${DB_TYPE} \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
Expand Down
Loading

0 comments on commit e47229a

Please sign in to comment.