mirror of
https://mirror.skon.top/github.com/zabbix/zabbix-docker
synced 2026-04-30 22:01:28 +08:00
Updated Dockerfiles for Oracle Linux images
This commit is contained in:
@@ -108,7 +108,7 @@ EXPOSE 10050/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -13,9 +13,10 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix
|
||||
|
||||
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
|
||||
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
|
||||
@@ -32,10 +33,11 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd", "/usr/sbin/zabbix_agentd"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "${ZABBIX_CONF_DIR}/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd /usr/sbin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/conf/ ${ZABBIX_CONF_DIR}/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -70,27 +72,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/ && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
|
||||
mkdir -p ${ZBX_USERPARAMETERDIR} && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
|
||||
${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
${ZABBIX_USER_HOME_DIR}/modules \
|
||||
${ZBX_USERPARAMETERDIR} && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ && \
|
||||
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ && \
|
||||
chgrp 0 ${ZABBIX_CONF_DIR} && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ && \
|
||||
${ZABBIX_USER_HOME_DIR}/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
|
||||
chmod g=u ${ZABBIX_CONF_DIR} && \
|
||||
/usr/sbin/zabbix_agentd -V
|
||||
|
||||
@@ -98,7 +94,7 @@ EXPOSE 10050/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ EXPOSE 10050/tcp 31999/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -13,11 +13,12 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix
|
||||
|
||||
ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" \
|
||||
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
|
||||
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
@@ -32,10 +33,11 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/", "/usr/sbin/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "${ZABBIX_CONF_DIR}/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -70,28 +72,22 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
|
||||
mkdir -p ${ZBX_USERPARAMETERDIR} && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
|
||||
${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
${ZABBIX_USER_HOME_DIR}/buffer \
|
||||
${ZBX_USERPARAMETERDIR} && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ && \
|
||||
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ && \
|
||||
chgrp 0 ${ZABBIX_CONF_DIR} && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
|
||||
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ && \
|
||||
${ZABBIX_USER_HOME_DIR}/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
|
||||
chmod g=u ${ZABBIX_CONF_DIR} && \
|
||||
/usr/sbin/zabbix_agent2 -V
|
||||
|
||||
@@ -99,7 +95,7 @@ EXPOSE 10050/tcp 31999/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
FROM ${OS_BASE_IMAGE}
|
||||
|
||||
@@ -7,11 +7,11 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
PATH=/usr/local/go/bin:$PATH \
|
||||
GOPATH=/root/go \
|
||||
GOCACHE=/root/.cache/go-build \
|
||||
GOMODCACHE=/root/go/pkg/mod \
|
||||
GOTELEMETRY=off \
|
||||
GOFLAGS="-buildvcs=false"
|
||||
GOFLAGS=-buildvcs=false
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \
|
||||
@@ -48,8 +48,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
OpenIPMI-devel \
|
||||
openldap-devel \
|
||||
sqlite-devel \
|
||||
postgresql-private-devel \
|
||||
postgresql-server-devel \
|
||||
libpq-devel \
|
||||
java-21-openjdk-devel \
|
||||
git \
|
||||
gettext \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-base:ol-${ZBX_VERSION}
|
||||
@@ -12,6 +12,7 @@ ARG GIT_BRANCH
|
||||
|
||||
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
|
||||
ARG CFLAGS
|
||||
ARG LDFLAGS
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
|
||||
@@ -25,156 +26,177 @@ 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"} \
|
||||
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
|
||||
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
|
||||
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} \
|
||||
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build/ \
|
||||
--mount=type=cache,target=/root/go/ \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
RUN --mount=from=sources,target=/tmp/src,ro \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches,ro \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
|
||||
if [ -f "/tmp/src/bootstrap.sh" ]; then \
|
||||
cp -R /tmp/src ${ZBX_SOURCES_DIR}; \
|
||||
mkdir -p \
|
||||
${ZBX_OUTPUT_DIR}/agent/sbin \
|
||||
${ZBX_OUTPUT_DIR}/agent/conf \
|
||||
${ZBX_OUTPUT_DIR}/agent2/sbin \
|
||||
${ZBX_OUTPUT_DIR}/agent2/conf \
|
||||
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
|
||||
${ZBX_OUTPUT_DIR}/proxy/sbin \
|
||||
${ZBX_OUTPUT_DIR}/proxy/conf \
|
||||
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
|
||||
${ZBX_OUTPUT_DIR}/server/sbin \
|
||||
${ZBX_OUTPUT_DIR}/server/conf \
|
||||
${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE} \
|
||||
${ZBX_OUTPUT_DIR}/java_gateway/sbin \
|
||||
${ZBX_OUTPUT_DIR}/web_service/sbin \
|
||||
${ZBX_OUTPUT_DIR}/web_service/conf \
|
||||
${ZBX_OUTPUT_DIR}/general/sbin \
|
||||
${ZBX_OUTPUT_DIR}/general/bin \
|
||||
${ZBX_OUTPUT_DIR}/general/conf && \
|
||||
if [ -f /tmp/src/bootstrap.sh ]; then \
|
||||
mkdir -p "${ZBX_SOURCES_DIR}" && \
|
||||
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
|
||||
else \
|
||||
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; \
|
||||
git -c advice.detachedHead=false clone \
|
||||
"${ZBX_SOURCES}" \
|
||||
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"${ZBX_SOURCES_DIR}"; \
|
||||
fi && \
|
||||
cd ${ZBX_SOURCES_DIR} && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
for patch_filename in /tmp/patches/*.patch; do \
|
||||
if [ -f "$patch_filename" ]; then \
|
||||
patch -p1 < "$patch_filename"; \
|
||||
fi \
|
||||
[ -f "$patch_filename" ] || continue; \
|
||||
patch -p1 < "$patch_filename"; \
|
||||
done && \
|
||||
zabbix_revision=`git rev-parse --short HEAD` && \
|
||||
if git rev-parse --short HEAD >/dev/null 2>&1; then \
|
||||
zabbix_revision="$(git rev-parse --short HEAD)"; \
|
||||
else \
|
||||
zabbix_revision="unknown"; \
|
||||
fi && \
|
||||
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 && \
|
||||
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/go/pkg/mod \
|
||||
--mount=from=config_templates,target=/tmp/conf,ro \
|
||||
set -eux && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
./bootstrap.sh && \
|
||||
./configure \
|
||||
--datadir=/usr/lib \
|
||||
--libdir=/usr/lib/zabbix \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/zabbix \
|
||||
--enable-ipv6 \
|
||||
--enable-agent \
|
||||
--enable-agent2 \
|
||||
--enable-java \
|
||||
--enable-proxy \
|
||||
--enable-server \
|
||||
--enable-webservice \
|
||||
--with-ares \
|
||||
--with-ldap \
|
||||
--with-libcurl \
|
||||
# --with-libmodbus \
|
||||
--with-libpcre2 \
|
||||
--with-libxml2 \
|
||||
--with-${DB_TYPE} \
|
||||
--with-net-snmp \
|
||||
--with-openipmi \
|
||||
--with-openssl \
|
||||
--with-ssh \
|
||||
--with-unixodbc \
|
||||
--silent && \
|
||||
make -j"$(nproc)" -s dbschema && \
|
||||
make -j"$(nproc)" -s && \
|
||||
make -j"$(nproc)" -s gettext && \
|
||||
cat database/${DB_TYPE}/schema.sql > database/${DB_TYPE}/create.sql && \
|
||||
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz && \
|
||||
cat database/${DB_TYPE}/images.sql >> database/${DB_TYPE}/create.sql && \
|
||||
cat database/${DB_TYPE}/data.sql >> database/${DB_TYPE}/create.sql && \
|
||||
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
|
||||
rm -rf database/${DB_TYPE}/create.sql && \
|
||||
curl --tlsv1.2 -sSf -L "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" -o ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
|
||||
curl --tlsv1.2 -sSf -L "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" -o ${ZBX_SOURCES_DIR}/ui/assets/fonts/OFL.txt && \
|
||||
sed -i -r "s/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/" ${ZBX_SOURCES_DIR}/ui/include/defines.inc.php && \
|
||||
sed -i -r "s/\.ttf/\.otf/" ${ZBX_SOURCES_DIR}/ui/include/graphs.inc.php && \
|
||||
rm -f ${ZBX_SOURCES_DIR}/ui/assets/fonts/DejaVuSans.ttf && \
|
||||
chmod o+r ${ZBX_SOURCES_DIR}/ui/assets/fonts/* && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
|
||||
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
|
||||
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
|
||||
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
|
||||
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
make -s distclean && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \
|
||||
cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \
|
||||
cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \
|
||||
cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/mongodb.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \
|
||||
cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \
|
||||
cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \
|
||||
cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/postgresql.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \
|
||||
cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \
|
||||
cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \
|
||||
cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/mssql.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${EMBER_PLUS_PLUGIN_SOURCES} --branch ${EMBER_PLUS_PLUGIN_VERSION} --depth 1 --single-branch /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION} && \
|
||||
cd /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
|
||||
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
|
||||
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
|
||||
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
|
||||
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
|
||||
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
|
||||
--datadir=/usr/lib \
|
||||
--libdir=/usr/lib/zabbix \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/zabbix \
|
||||
--enable-ipv6 \
|
||||
--enable-agent \
|
||||
--enable-agent2 \
|
||||
--enable-java \
|
||||
--enable-proxy \
|
||||
--enable-server \
|
||||
--enable-webservice \
|
||||
--with-ares \
|
||||
--with-ldap \
|
||||
--with-libcurl \
|
||||
# --with-libmodbus \
|
||||
--with-libpcre2 \
|
||||
--with-libxml2 \
|
||||
--with-${DB_TYPE} \
|
||||
--with-net-snmp \
|
||||
--with-openipmi \
|
||||
--with-openssl \
|
||||
--with-ssh \
|
||||
--with-unixodbc \
|
||||
--silent && \
|
||||
jobs="$(nproc)" && \
|
||||
make -j"${jobs}" -s dbschema && \
|
||||
make -j"${jobs}" -s && \
|
||||
make -j"${jobs}" -s gettext && \
|
||||
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
|
||||
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
|
||||
cat "database/${DB_TYPE}/images.sql" >> "database/${DB_TYPE}/create.sql" && \
|
||||
cat "database/${DB_TYPE}/data.sql" >> "database/${DB_TYPE}/create.sql" && \
|
||||
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz" && \
|
||||
rm -f "database/${DB_TYPE}/create.sql" && \
|
||||
strip src/zabbix_agent/zabbix_agentd && \
|
||||
strip src/zabbix_server/zabbix_server && \
|
||||
strip src/zabbix_proxy/zabbix_proxy && \
|
||||
strip src/zabbix_get/zabbix_get && \
|
||||
strip src/zabbix_sender/zabbix_sender && \
|
||||
strip src/go/bin/zabbix_agent2 || true && \
|
||||
strip src/go/bin/zabbix_web_service || true && \
|
||||
cp src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
|
||||
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
|
||||
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
|
||||
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
|
||||
cp src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
|
||||
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
|
||||
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
|
||||
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
|
||||
cp src/zabbix_server/zabbix_server "${ZBX_OUTPUT_DIR}/server/sbin/" && \
|
||||
cp conf/zabbix_server.conf "${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf.dist" && \
|
||||
cp -a /tmp/conf/server/. "${ZBX_OUTPUT_DIR}/server/conf/" && \
|
||||
cp src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
|
||||
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
|
||||
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
|
||||
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
|
||||
cp -a src/zabbix_java/lib/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
|
||||
cp src/go/bin/zabbix_web_service "${ZBX_OUTPUT_DIR}/web_service/sbin/" && \
|
||||
cp src/go/conf/zabbix_web_service.conf "${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf.dist" && \
|
||||
cp -a /tmp/conf/web_service/. "${ZBX_OUTPUT_DIR}/web_service/conf/" && \
|
||||
cp src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
|
||||
cp src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
|
||||
make -s distclean
|
||||
|
||||
RUN set -eux && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
|
||||
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
|
||||
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
|
||||
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
|
||||
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
|
||||
-o ui/assets/fonts/OFL.txt && \
|
||||
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
|
||||
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
|
||||
rm -f ui/assets/fonts/DejaVuSans.ttf && \
|
||||
chmod o+r ui/assets/fonts/*
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/go/pkg/mod \
|
||||
set -eux && \
|
||||
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
|
||||
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
|
||||
build_plugin() { \
|
||||
name="$1"; \
|
||||
repo="$2"; \
|
||||
version="$3"; \
|
||||
binary="$4"; \
|
||||
conf="$5"; \
|
||||
outname="$6"; \
|
||||
workdir="/tmp/${name}-plugin-${version}"; \
|
||||
rm -rf "$workdir"; \
|
||||
git -c advice.detachedHead=false clone "$repo" \
|
||||
--branch "$version" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"$workdir"; \
|
||||
cd "$workdir"; \
|
||||
make; \
|
||||
strip "$binary" || true; \
|
||||
cp "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
|
||||
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
|
||||
make clean; \
|
||||
}; \
|
||||
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
|
||||
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
|
||||
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-mssql mssql.conf mssql && \
|
||||
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
|
||||
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-base:ol-${ZBX_VERSION}
|
||||
@@ -12,6 +12,7 @@ ARG GIT_BRANCH
|
||||
|
||||
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
|
||||
ARG CFLAGS
|
||||
ARG LDFLAGS
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \
|
||||
@@ -25,161 +26,177 @@ 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"} \
|
||||
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
|
||||
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
|
||||
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} \
|
||||
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build/ \
|
||||
--mount=type=cache,target=/root/go/ \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
RUN --mount=from=sources,target=/tmp/src,ro \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches,ro \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/option-patches/with-compression/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/option-patches/without-compression/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
|
||||
if [ -f "/tmp/src/bootstrap.sh" ]; then \
|
||||
cp -R /tmp/src ${ZBX_SOURCES_DIR}; \
|
||||
mkdir -p \
|
||||
${ZBX_OUTPUT_DIR}/agent/sbin \
|
||||
${ZBX_OUTPUT_DIR}/agent/conf \
|
||||
${ZBX_OUTPUT_DIR}/agent2/sbin \
|
||||
${ZBX_OUTPUT_DIR}/agent2/conf \
|
||||
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
|
||||
${ZBX_OUTPUT_DIR}/proxy/sbin \
|
||||
${ZBX_OUTPUT_DIR}/proxy/conf \
|
||||
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
|
||||
${ZBX_OUTPUT_DIR}/server/sbin \
|
||||
${ZBX_OUTPUT_DIR}/server/conf \
|
||||
${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE} \
|
||||
${ZBX_OUTPUT_DIR}/java_gateway/sbin \
|
||||
${ZBX_OUTPUT_DIR}/web_service/sbin \
|
||||
${ZBX_OUTPUT_DIR}/web_service/conf \
|
||||
${ZBX_OUTPUT_DIR}/general/sbin \
|
||||
${ZBX_OUTPUT_DIR}/general/bin \
|
||||
${ZBX_OUTPUT_DIR}/general/conf && \
|
||||
if [ -f /tmp/src/bootstrap.sh ]; then \
|
||||
mkdir -p "${ZBX_SOURCES_DIR}" && \
|
||||
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
|
||||
else \
|
||||
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; \
|
||||
git -c advice.detachedHead=false clone \
|
||||
"${ZBX_SOURCES}" \
|
||||
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"${ZBX_SOURCES_DIR}"; \
|
||||
fi && \
|
||||
cd ${ZBX_SOURCES_DIR} && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
for patch_filename in /tmp/patches/*.patch; do \
|
||||
if [ -f "$patch_filename" ]; then \
|
||||
patch -p1 < "$patch_filename"; \
|
||||
fi \
|
||||
[ -f "$patch_filename" ] || continue; \
|
||||
patch -p1 < "$patch_filename"; \
|
||||
done && \
|
||||
zabbix_revision=`git rev-parse --short HEAD` && \
|
||||
if git rev-parse --short HEAD >/dev/null 2>&1; then \
|
||||
zabbix_revision="$(git rev-parse --short HEAD)"; \
|
||||
else \
|
||||
zabbix_revision="unknown"; \
|
||||
fi && \
|
||||
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 && \
|
||||
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/go/pkg/mod \
|
||||
--mount=from=config_templates,target=/tmp/conf,ro \
|
||||
set -eux && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
./bootstrap.sh && \
|
||||
./configure \
|
||||
--datadir=/usr/lib \
|
||||
--libdir=/usr/lib/zabbix \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/zabbix \
|
||||
--enable-agent \
|
||||
--enable-agent2 \
|
||||
--enable-ipv6 \
|
||||
--enable-java \
|
||||
--enable-proxy \
|
||||
--enable-server \
|
||||
--enable-webservice \
|
||||
--with-ares \
|
||||
--with-ldap \
|
||||
--with-libcurl \
|
||||
# --with-libmodbus \
|
||||
--with-libpcre2 \
|
||||
--with-libxml2 \
|
||||
--with-${DB_TYPE} \
|
||||
--with-net-snmp \
|
||||
--with-openipmi \
|
||||
--with-openssl \
|
||||
--with-ssh \
|
||||
--with-unixodbc \
|
||||
--silent && \
|
||||
make -j"$(nproc)" -s dbschema && \
|
||||
make -j"$(nproc)" -s && \
|
||||
make -j"$(nproc)" -s gettext && \
|
||||
cat database/${DB_TYPE}/schema.sql > database/${DB_TYPE}/create.sql && \
|
||||
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz && \
|
||||
cat database/${DB_TYPE}/images.sql >> database/${DB_TYPE}/create.sql && \
|
||||
cat database/${DB_TYPE}/data.sql >> database/${DB_TYPE}/create.sql && \
|
||||
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
|
||||
rm -rf database/${DB_TYPE}/create.sql && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/database/postgresql/timescaledb/schema.sql ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/timescaledb.sql && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/database/postgresql/timescaledb/option-patches/with-compression/*.sql ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/option-patches/with-compression/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/database/postgresql/timescaledb/option-patches/without-compression/*.sql ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/option-patches/without-compression/ && \
|
||||
curl --tlsv1.2 -sSf -L "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" -o ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
|
||||
curl --tlsv1.2 -sSf -L "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" -o ${ZBX_SOURCES_DIR}/ui/assets/fonts/OFL.txt && \
|
||||
sed -i -r "s/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/" ${ZBX_SOURCES_DIR}/ui/include/defines.inc.php && \
|
||||
sed -i -r "s/\.ttf/\.otf/" ${ZBX_SOURCES_DIR}/ui/include/graphs.inc.php && \
|
||||
rm -f ${ZBX_SOURCES_DIR}/ui/assets/fonts/DejaVuSans.ttf && \
|
||||
chmod o+r ${ZBX_SOURCES_DIR}/ui/assets/fonts/* && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
|
||||
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
|
||||
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
|
||||
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
|
||||
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
|
||||
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
make -s distclean && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \
|
||||
cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \
|
||||
cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \
|
||||
cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/mongodb.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \
|
||||
cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \
|
||||
cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \
|
||||
cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/postgresql.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \
|
||||
cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \
|
||||
cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \
|
||||
cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/mssql.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${EMBER_PLUS_PLUGIN_SOURCES} --branch ${EMBER_PLUS_PLUGIN_VERSION} --depth 1 --single-branch /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION} && \
|
||||
cd /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
|
||||
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
|
||||
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
|
||||
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
|
||||
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
|
||||
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
|
||||
--datadir=/usr/lib \
|
||||
--libdir=/usr/lib/zabbix \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/zabbix \
|
||||
--enable-ipv6 \
|
||||
--enable-agent \
|
||||
--enable-agent2 \
|
||||
--enable-java \
|
||||
--enable-proxy \
|
||||
--enable-server \
|
||||
--enable-webservice \
|
||||
--with-ares \
|
||||
--with-ldap \
|
||||
--with-libcurl \
|
||||
# --with-libmodbus \
|
||||
--with-libpcre2 \
|
||||
--with-libxml2 \
|
||||
--with-${DB_TYPE} \
|
||||
--with-net-snmp \
|
||||
--with-openipmi \
|
||||
--with-openssl \
|
||||
--with-ssh \
|
||||
--with-unixodbc \
|
||||
--silent && \
|
||||
jobs="$(nproc)" && \
|
||||
make -j"${jobs}" -s dbschema && \
|
||||
make -j"${jobs}" -s && \
|
||||
make -j"${jobs}" -s gettext && \
|
||||
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
|
||||
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
|
||||
cat "database/${DB_TYPE}/images.sql" >> "database/${DB_TYPE}/create.sql" && \
|
||||
cat "database/${DB_TYPE}/data.sql" >> "database/${DB_TYPE}/create.sql" && \
|
||||
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz" && \
|
||||
rm -f "database/${DB_TYPE}/create.sql" && \
|
||||
strip src/zabbix_agent/zabbix_agentd && \
|
||||
strip src/zabbix_server/zabbix_server && \
|
||||
strip src/zabbix_proxy/zabbix_proxy && \
|
||||
strip src/zabbix_get/zabbix_get && \
|
||||
strip src/zabbix_sender/zabbix_sender && \
|
||||
strip src/go/bin/zabbix_agent2 || true && \
|
||||
strip src/go/bin/zabbix_web_service || true && \
|
||||
cp src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
|
||||
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
|
||||
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
|
||||
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
|
||||
cp src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
|
||||
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
|
||||
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
|
||||
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
|
||||
cp src/zabbix_server/zabbix_server "${ZBX_OUTPUT_DIR}/server/sbin/" && \
|
||||
cp conf/zabbix_server.conf "${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf.dist" && \
|
||||
cp -a /tmp/conf/server/. "${ZBX_OUTPUT_DIR}/server/conf/" && \
|
||||
cp src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
|
||||
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
|
||||
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
|
||||
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
|
||||
cp -a src/zabbix_java/lib/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
|
||||
cp src/go/bin/zabbix_web_service "${ZBX_OUTPUT_DIR}/web_service/sbin/" && \
|
||||
cp src/go/conf/zabbix_web_service.conf "${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf.dist" && \
|
||||
cp -a /tmp/conf/web_service/. "${ZBX_OUTPUT_DIR}/web_service/conf/" && \
|
||||
cp src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
|
||||
cp src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
|
||||
make -s distclean
|
||||
|
||||
RUN set -eux && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
|
||||
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
|
||||
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
|
||||
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
|
||||
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
|
||||
-o ui/assets/fonts/OFL.txt && \
|
||||
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
|
||||
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
|
||||
rm -f ui/assets/fonts/DejaVuSans.ttf && \
|
||||
chmod o+r ui/assets/fonts/*
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/go/pkg/mod \
|
||||
set -eux && \
|
||||
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
|
||||
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
|
||||
build_plugin() { \
|
||||
name="$1"; \
|
||||
repo="$2"; \
|
||||
version="$3"; \
|
||||
binary="$4"; \
|
||||
conf="$5"; \
|
||||
outname="$6"; \
|
||||
workdir="/tmp/${name}-plugin-${version}"; \
|
||||
rm -rf "$workdir"; \
|
||||
git -c advice.detachedHead=false clone "$repo" \
|
||||
--branch "$version" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"$workdir"; \
|
||||
cd "$workdir"; \
|
||||
make; \
|
||||
strip "$binary" || true; \
|
||||
cp "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
|
||||
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
|
||||
make clean; \
|
||||
}; \
|
||||
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
|
||||
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
|
||||
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-mssql mssql.conf mssql && \
|
||||
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
|
||||
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-base:ol-${ZBX_VERSION}
|
||||
@@ -12,6 +12,7 @@ ARG GIT_BRANCH
|
||||
|
||||
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
|
||||
ARG CFLAGS
|
||||
ARG LDFLAGS
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \
|
||||
@@ -25,133 +26,158 @@ 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=sqlite3 \
|
||||
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
|
||||
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
|
||||
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
|
||||
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} \
|
||||
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build/ \
|
||||
--mount=type=cache,target=/root/go/ \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
RUN --mount=from=sources,target=/tmp/src,ro \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches,ro \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
|
||||
if [ -f "/tmp/src/bootstrap.sh" ]; then \
|
||||
cp -R /tmp/src ${ZBX_SOURCES_DIR}; \
|
||||
mkdir -p \
|
||||
${ZBX_OUTPUT_DIR}/agent/sbin \
|
||||
${ZBX_OUTPUT_DIR}/agent/conf \
|
||||
${ZBX_OUTPUT_DIR}/agent2/sbin \
|
||||
${ZBX_OUTPUT_DIR}/agent2/conf \
|
||||
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
|
||||
${ZBX_OUTPUT_DIR}/proxy/sbin \
|
||||
${ZBX_OUTPUT_DIR}/proxy/conf \
|
||||
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
|
||||
${ZBX_OUTPUT_DIR}/java_gateway/sbin \
|
||||
${ZBX_OUTPUT_DIR}/general/sbin \
|
||||
${ZBX_OUTPUT_DIR}/general/bin \
|
||||
${ZBX_OUTPUT_DIR}/general/conf && \
|
||||
if [ -f /tmp/src/bootstrap.sh ]; then \
|
||||
mkdir -p "${ZBX_SOURCES_DIR}" && \
|
||||
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
|
||||
else \
|
||||
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; \
|
||||
git -c advice.detachedHead=false clone \
|
||||
"${ZBX_SOURCES}" \
|
||||
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"${ZBX_SOURCES_DIR}"; \
|
||||
fi && \
|
||||
cd ${ZBX_SOURCES_DIR} && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
for patch_filename in /tmp/patches/*.patch; do \
|
||||
if [ -f "$patch_filename" ]; then \
|
||||
patch -p1 < "$patch_filename"; \
|
||||
fi \
|
||||
[ -f "$patch_filename" ] || continue; \
|
||||
patch -p1 < "$patch_filename"; \
|
||||
done && \
|
||||
zabbix_revision=`git rev-parse --short HEAD` && \
|
||||
if git rev-parse --short HEAD >/dev/null 2>&1; then \
|
||||
zabbix_revision="$(git rev-parse --short HEAD)"; \
|
||||
else \
|
||||
zabbix_revision="unknown"; \
|
||||
fi && \
|
||||
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 && \
|
||||
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/go/pkg/mod \
|
||||
--mount=from=config_templates,target=/tmp/conf,ro \
|
||||
set -eux && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
./bootstrap.sh && \
|
||||
./configure \
|
||||
--datadir=/usr/lib \
|
||||
--libdir=/usr/lib/zabbix \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/zabbix \
|
||||
--enable-ipv6 \
|
||||
--enable-agent \
|
||||
--enable-agent2 \
|
||||
--enable-java \
|
||||
--enable-proxy \
|
||||
--with-ares \
|
||||
--with-ldap \
|
||||
--with-libcurl \
|
||||
# --with-libmodbus \
|
||||
--with-libpcre2 \
|
||||
--with-libxml2 \
|
||||
--with-${DB_TYPE} \
|
||||
--with-net-snmp \
|
||||
--with-openipmi \
|
||||
--with-openssl \
|
||||
--with-ssh \
|
||||
--with-unixodbc \
|
||||
--silent && \
|
||||
make -j"$(nproc)" -s dbschema && \
|
||||
make -j"$(nproc)" -s && \
|
||||
curl --tlsv1.2 -sSf -L "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" -o ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
|
||||
curl --tlsv1.2 -sSf -L "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" -o ${ZBX_SOURCES_DIR}/ui/assets/fonts/OFL.txt && \
|
||||
sed -i -r "s/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/" ${ZBX_SOURCES_DIR}/ui/include/defines.inc.php && \
|
||||
sed -i -r "s/\.ttf/\.otf/" ${ZBX_SOURCES_DIR}/ui/include/graphs.inc.php && \
|
||||
rm -f ${ZBX_SOURCES_DIR}/ui/assets/fonts/DejaVuSans.ttf && \
|
||||
chmod o+r ${ZBX_SOURCES_DIR}/ui/assets/fonts/* && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get && \
|
||||
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
|
||||
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
|
||||
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
|
||||
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
|
||||
make -s distclean && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \
|
||||
cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \
|
||||
cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \
|
||||
cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/mongodb.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \
|
||||
cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \
|
||||
cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \
|
||||
cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/postgresql.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \
|
||||
cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \
|
||||
cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \
|
||||
cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/mssql.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${EMBER_PLUS_PLUGIN_SOURCES} --branch ${EMBER_PLUS_PLUGIN_VERSION} --depth 1 --single-branch /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION} && \
|
||||
cd /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
|
||||
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
|
||||
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
|
||||
cd /tmp/ && \
|
||||
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
|
||||
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
|
||||
make && \
|
||||
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
|
||||
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
|
||||
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
|
||||
--datadir=/usr/lib \
|
||||
--libdir=/usr/lib/zabbix \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/zabbix \
|
||||
--enable-ipv6 \
|
||||
--enable-agent \
|
||||
--enable-agent2 \
|
||||
--enable-java \
|
||||
--enable-proxy \
|
||||
--with-ares \
|
||||
--with-ldap \
|
||||
--with-libcurl \
|
||||
# --with-libmodbus \
|
||||
--with-libpcre2 \
|
||||
--with-libxml2 \
|
||||
--with-${DB_TYPE} \
|
||||
--with-net-snmp \
|
||||
--with-openipmi \
|
||||
--with-openssl \
|
||||
--with-ssh \
|
||||
--with-unixodbc \
|
||||
--silent && \
|
||||
jobs="$(nproc)" && \
|
||||
make -j"${jobs}" -s dbschema && \
|
||||
make -j"${jobs}" -s && \
|
||||
make -j"${jobs}" -s gettext && \
|
||||
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
|
||||
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
|
||||
strip src/zabbix_agent/zabbix_agentd && \
|
||||
strip src/zabbix_proxy/zabbix_proxy && \
|
||||
strip src/zabbix_get/zabbix_get && \
|
||||
strip src/zabbix_sender/zabbix_sender && \
|
||||
strip src/go/bin/zabbix_agent2 || true && \
|
||||
cp src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
|
||||
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
|
||||
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
|
||||
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
|
||||
cp src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
|
||||
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
|
||||
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
|
||||
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
|
||||
cp src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
|
||||
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
|
||||
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
|
||||
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
|
||||
cp -a src/zabbix_java/lib/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
|
||||
cp src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
|
||||
cp src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
|
||||
make -s distclean
|
||||
|
||||
RUN set -eux && \
|
||||
cd "${ZBX_SOURCES_DIR}" && \
|
||||
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
|
||||
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
|
||||
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
|
||||
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
|
||||
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
|
||||
-o ui/assets/fonts/OFL.txt && \
|
||||
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
|
||||
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
|
||||
rm -f ui/assets/fonts/DejaVuSans.ttf && \
|
||||
chmod o+r ui/assets/fonts/*
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/root/go/pkg/mod \
|
||||
set -eux && \
|
||||
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
|
||||
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
|
||||
build_plugin() { \
|
||||
name="$1"; \
|
||||
repo="$2"; \
|
||||
version="$3"; \
|
||||
binary="$4"; \
|
||||
conf="$5"; \
|
||||
outname="$6"; \
|
||||
workdir="/tmp/${name}-plugin-${version}"; \
|
||||
rm -rf "$workdir"; \
|
||||
git -c advice.detachedHead=false clone "$repo" \
|
||||
--branch "$version" \
|
||||
--depth 1 \
|
||||
--single-branch \
|
||||
"$workdir"; \
|
||||
cd "$workdir"; \
|
||||
make; \
|
||||
strip "$binary" || true; \
|
||||
cp "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
|
||||
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
|
||||
make clean; \
|
||||
}; \
|
||||
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
|
||||
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
|
||||
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-mssql mssql.conf mssql && \
|
||||
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
|
||||
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
|
||||
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu
|
||||
|
||||
@@ -41,13 +41,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
java-21-openjdk-headless \
|
||||
findutils" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
groupadd \
|
||||
--system \
|
||||
--gid 1995 \
|
||||
@@ -74,7 +75,7 @@ EXPOSE 10052/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -13,9 +13,10 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
|
||||
@@ -29,7 +30,8 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/java_gateway/sbin/", "/usr/sbin/zabbix_java/"]
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/java_gateway/sbin/ /usr/sbin/zabbix_java/
|
||||
COPY conf/usr/sbin/zabbix_java_gateway /usr/sbin/
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -38,13 +40,13 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
java-21-openjdk-headless \
|
||||
findutils" && \
|
||||
microdnf -y install \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="ol10_baseos_latest" \
|
||||
--enablerepo="ol10_appstream" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="ol10_baseos_latest" \
|
||||
--enablerepo="ol10_appstream" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
groupadd \
|
||||
--system \
|
||||
@@ -58,21 +60,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/ && \
|
||||
mkdir -p /usr/sbin/zabbix_java/ && \
|
||||
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/ \
|
||||
/usr/sbin/zabbix_java/ext_lib/ && \
|
||||
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
|
||||
mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/ \
|
||||
/usr/sbin/zabbix_java/ext_lib" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST}
|
||||
|
||||
EXPOSE 10052/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -74,22 +74,24 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
zlib \
|
||||
unixODBC" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo "crb" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo "*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--enablerepo="crb" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--enablerepo "baseos" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
@@ -140,7 +142,7 @@ WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -13,20 +13,21 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \
|
||||
NMAP_PRIVILEGED="" \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix"
|
||||
NMAP_PRIVILEGED= \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix
|
||||
|
||||
ENV ZBX_DB_NAME="dummy_db_name" \
|
||||
ZBX_FPINGLOCATION="/usr/sbin/fping" \
|
||||
ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
|
||||
ZBX_SNMPTRAPPERFILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" \
|
||||
ZBX_SSHKEYLOCATION="${ZABBIX_USER_HOME_DIR}/ssh_keys/" \
|
||||
ZBX_SSLCERTLOCATION="${ZABBIX_USER_HOME_DIR}/ssl/certs/" \
|
||||
ZBX_SSLKEYLOCATION="${ZABBIX_USER_HOME_DIR}/ssl/keys/" \
|
||||
ZBX_SSLCALOCATION="${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca/"
|
||||
ENV ZBX_DB_NAME=dummy_db_name \
|
||||
ZBX_FPINGLOCATION=/usr/sbin/fping \
|
||||
ZBX_LOADMODULEPATH=${ZABBIX_USER_HOME_DIR}/modules \
|
||||
ZBX_SNMPTRAPPERFILE=${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log \
|
||||
ZBX_SSHKEYLOCATION=${ZABBIX_USER_HOME_DIR}/ssh_keys/ \
|
||||
ZBX_SSLCERTLOCATION=${ZABBIX_USER_HOME_DIR}/ssl/certs/ \
|
||||
ZBX_SSLKEYLOCATION=${ZABBIX_USER_HOME_DIR}/ssl/keys/ \
|
||||
ZBX_SSLCALOCATION=${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca/
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix proxy with MySQL database support" \
|
||||
@@ -40,11 +41,12 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/sbin/zabbix_proxy", "/usr/sbin/zabbix_proxy"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/conf/", "${ZABBIX_CONF_DIR}/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/proxy/database/mysql/", "/usr/share/doc/zabbix-proxy-mysql/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/proxy/sbin/zabbix_proxy /usr/sbin/zabbix_proxy
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/proxy/conf/ ${ZABBIX_CONF_DIR}/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/proxy/database/mysql/ /usr/share/doc/zabbix-proxy-mysql/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -59,6 +61,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
file-libs \
|
||||
fping \
|
||||
iputils \
|
||||
libcurl \
|
||||
libxml2 \
|
||||
mysql8.4 \
|
||||
mysql8.4-libs \
|
||||
@@ -72,15 +75,15 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
gzip \
|
||||
unixODBC" && \
|
||||
microdnf -y install \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="ol10_baseos_latest" \
|
||||
--enablerepo="ol10_appstream" \
|
||||
--enablerepo="ol10_codeready_builder" \
|
||||
--enablerepo="ol10_u0_developer_EPEL" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="ol10_baseos_latest" \
|
||||
--enablerepo="ol10_appstream" \
|
||||
--enablerepo="ol10_codeready_builder" \
|
||||
--enablerepo="ol10_u0_developer_EPEL" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
groupadd \
|
||||
--system \
|
||||
@@ -96,25 +99,26 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
zabbix && \
|
||||
chgrp zabbix /usr/bin/nmap && \
|
||||
setcap cap_net_raw+eip /usr/bin/nmap && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/ && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssh_keys && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
|
||||
mkdir -p /usr/lib/zabbix/externalscripts && \
|
||||
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
|
||||
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
|
||||
chgrp 0 ${ZABBIX_CONF_DIR} && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
${ZABBIX_USER_HOME_DIR}/mibs \
|
||||
${ZABBIX_USER_HOME_DIR}/modules \
|
||||
${ZABBIX_USER_HOME_DIR}/snmptraps \
|
||||
${ZABBIX_USER_HOME_DIR}/ssh_keys \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl/certs \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl/keys \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca \
|
||||
/usr/lib/zabbix/externalscripts \
|
||||
/usr/share/doc/zabbix-proxy-mysql && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf \
|
||||
${ZABBIX_USER_HOME_DIR}/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
|
||||
chmod g=u ${ZABBIX_CONF_DIR} && \
|
||||
/usr/sbin/zabbix_proxy -V
|
||||
|
||||
@@ -124,7 +128,7 @@ WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -78,24 +78,26 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
gzip \
|
||||
unixODBC" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo "crb" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo "crb" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--enablerepo="baseos" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
@@ -149,7 +151,7 @@ WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps", "${ZABBIX_USER_HOME_DIR}/export"]
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -13,20 +13,21 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \
|
||||
NMAP_PRIVILEGED="" \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix"
|
||||
NMAP_PRIVILEGED= \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix
|
||||
|
||||
ENV ZBX_DB_NAME="dummy_db_name" \
|
||||
ZBX_FPINGLOCATION="/usr/sbin/fping" \
|
||||
ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
|
||||
ZBX_SNMPTRAPPERFILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log" \
|
||||
ZBX_SSHKEYLOCATION="${ZABBIX_USER_HOME_DIR}/ssh_keys/" \
|
||||
ZBX_SSLCERTLOCATION="${ZABBIX_USER_HOME_DIR}/ssl/certs/" \
|
||||
ZBX_SSLKEYLOCATION="${ZABBIX_USER_HOME_DIR}/ssl/keys/" \
|
||||
ZBX_SSLCALOCATION="${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca/"
|
||||
ENV ZBX_DB_NAME=dummy_db_name \
|
||||
ZBX_FPINGLOCATION=/usr/sbin/fping \
|
||||
ZBX_LOADMODULEPATH=${ZABBIX_USER_HOME_DIR}/modules \
|
||||
ZBX_SNMPTRAPPERFILE=${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log \
|
||||
ZBX_SSHKEYLOCATION=${ZABBIX_USER_HOME_DIR}/ssh_keys/ \
|
||||
ZBX_SSLCERTLOCATION=${ZABBIX_USER_HOME_DIR}/ssl/certs/ \
|
||||
ZBX_SSLKEYLOCATION=${ZABBIX_USER_HOME_DIR}/ssl/keys/ \
|
||||
ZBX_SSLCALOCATION=${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca/
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix server with MySQL database support" \
|
||||
@@ -40,11 +41,12 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/server/sbin/zabbix_server", "/usr/sbin/zabbix_server"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/server/conf/", "${ZABBIX_CONF_DIR}/"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/server/database/mysql/create.sql.gz", "/usr/share/doc/zabbix-server-mysql/create.sql.gz"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/server/sbin/zabbix_server /usr/sbin/zabbix_server
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/server/conf/ ${ZABBIX_CONF_DIR}/
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/server/database/mysql/create.sql.gz /usr/share/doc/zabbix-server-mysql/create.sql.gz
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -59,6 +61,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
file-libs \
|
||||
iputils \
|
||||
traceroute \
|
||||
libcurl \
|
||||
libevent \
|
||||
libxml2 \
|
||||
libssh \
|
||||
@@ -99,28 +102,29 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
zabbix && \
|
||||
chgrp zabbix /usr/bin/nmap && \
|
||||
setcap cap_net_raw+eip /usr/bin/nmap && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/dbscripts && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/export && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssh_keys && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
|
||||
mkdir -p /usr/lib/zabbix/alertscripts && \
|
||||
mkdir -p /usr/lib/zabbix/externalscripts && \
|
||||
mkdir -p /usr/share/doc/zabbix-server-mysql && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_server_modules.conf ${ZABBIX_USER_HOME_DIR} && \
|
||||
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_server_modules.conf ${ZABBIX_USER_HOME_DIR} && \
|
||||
chgrp 0 ${ZABBIX_CONF_DIR} && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_server_modules.conf ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/dbscripts \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
${ZABBIX_USER_HOME_DIR}/export \
|
||||
${ZABBIX_USER_HOME_DIR}/mibs \
|
||||
${ZABBIX_USER_HOME_DIR}/modules \
|
||||
${ZABBIX_USER_HOME_DIR}/snmptraps \
|
||||
${ZABBIX_USER_HOME_DIR}/ssh_keys \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl/certs \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl/keys \
|
||||
${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca \
|
||||
/usr/lib/zabbix/alertscripts \
|
||||
/usr/lib/zabbix/externalscripts \
|
||||
/usr/share/doc/zabbix-server-mysql && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/zabbix_server_modules.conf \
|
||||
${ZABBIX_USER_HOME_DIR}/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
|
||||
chmod g=u ${ZABBIX_CONF_DIR} && \
|
||||
/usr/sbin/zabbix_server -V
|
||||
|
||||
@@ -130,7 +134,7 @@ WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps", "${ZABBIX_USER_HOME_DIR}/export"]
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -39,13 +39,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
shadow-utils \
|
||||
net-snmp" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
groupadd \
|
||||
--system \
|
||||
--gid 1995 \
|
||||
@@ -58,6 +59,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/snmptraps \
|
||||
${ZABBIX_USER_HOME_DIR}/mibs \
|
||||
${SNMP_PERSISTENT_DIR} && \
|
||||
FIX_PERM_LIST="\
|
||||
/etc/snmp/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
FROM ${OS_BASE_IMAGE}
|
||||
|
||||
@@ -7,13 +7,14 @@ ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \
|
||||
ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \
|
||||
ZBX_SNMP_TRAP_USE_DNS=false \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix
|
||||
|
||||
ENV SNMP_PERSISTENT_DIR="${ZABBIX_USER_HOME_DIR}/snmptrapd_config"
|
||||
ENV SNMP_PERSISTENT_DIR=${ZABBIX_USER_HOME_DIR}/snmptrapd_config
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix SNMP traps receiver" \
|
||||
@@ -26,6 +27,10 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY conf/etc/logrotate.d/zabbix_snmptraps /etc/logrotate.d/
|
||||
COPY conf/etc/snmp/snmptrapd.conf /etc/snmp/
|
||||
COPY conf/usr/sbin/zabbix_trap_handler.sh conf/usr/sbin/snmptrapd_runner.sh /usr/sbin/
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
set -eux && \
|
||||
@@ -52,13 +57,18 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
|
||||
mkdir -p ${SNMP_PERSISTENT_DIR} && \
|
||||
chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
|
||||
chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
|
||||
chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/snmptraps \
|
||||
${ZABBIX_USER_HOME_DIR}/mibs \
|
||||
${SNMP_PERSISTENT_DIR} && \
|
||||
FIX_PERM_LIST="\
|
||||
/etc/snmp/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ \
|
||||
/var/tmp/ \
|
||||
/var/run/" && \
|
||||
chown --quiet -R zabbix:root ${FIX_PERM_LIST} && \
|
||||
chgrp -R 0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST}
|
||||
|
||||
EXPOSE 1162/udp
|
||||
|
||||
@@ -66,11 +76,6 @@ WORKDIR ${ZABBIX_USER_HOME_DIR}/snmptraps/
|
||||
|
||||
VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps", "${SNMP_PERSISTENT_DIR}"]
|
||||
|
||||
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
|
||||
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]
|
||||
COPY ["conf/usr/sbin/zabbix_trap_handler.sh", "/usr/sbin/"]
|
||||
COPY ["conf/usr/sbin/snmptrapd_runner.sh", "/usr/sbin/"]
|
||||
|
||||
USER 1997
|
||||
|
||||
CMD ["/usr/sbin/snmptrapd_runner.sh"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -70,21 +70,23 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
gzip \
|
||||
supervisor" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--enablerepo "baseos" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION}
|
||||
|
||||
FROM ${BUILD_BASE_IMAGE} AS builder
|
||||
FROM builder AS clean_builder
|
||||
|
||||
ARG ZBX_VERSION
|
||||
|
||||
RUN set -eux && \
|
||||
rm -rf \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/tests" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php.example" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/maintenance.inc.php" && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.po' -delete && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.sh' -delete
|
||||
|
||||
FROM ${OS_BASE_IMAGE}
|
||||
|
||||
@@ -13,10 +25,11 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix" \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_WWW_ROOT="/usr/share/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_WWW_ROOT=/usr/share/zabbix
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \
|
||||
@@ -30,9 +43,9 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "${ZABBIX_WWW_ROOT}"]
|
||||
COPY ["conf/etc/", "/etc/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=clean_builder /tmp/zabbix-${ZBX_VERSION}/ui ${ZABBIX_WWW_ROOT}/
|
||||
COPY conf/etc/ /etc/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -78,38 +91,36 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
rm -f "/etc/httpd/conf.d/default.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/ssl.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/autoindex.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/php.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/userdir.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/welcome.conf" && \
|
||||
rm -f /etc/php-fpm.d/www.conf && \
|
||||
find /etc/ -name '*.rpmnew' | xargs rm -f && \
|
||||
cd ${ZABBIX_WWW_ROOT}/ && \
|
||||
rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \
|
||||
rm -rf tests && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
cat ${ZABBIX_WWW_ROOT}/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
|
||||
cut -d"'" -f 2 | sort | \
|
||||
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_USER_HOME_DIR}/ /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
|
||||
chgrp -R 0 ${ZABBIX_USER_HOME_DIR}/ /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
|
||||
chmod -R g=u ${ZABBIX_USER_HOME_DIR}/ /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
|
||||
chown --quiet -R zabbix:root /run/httpd/ /var/lib/php/session/ && \
|
||||
chgrp -R 0 /run/httpd/ /var/lib/php/session/ && \
|
||||
chmod -R g=u /run/httpd/ /var/lib/php/session/ && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_CONF_DIR}/web \
|
||||
${ZABBIX_CONF_DIR}/web/certs \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
/var/lib/php/session && \
|
||||
rm -rf /etc/httpd/conf.d/default.conf \
|
||||
/etc/httpd/conf.d/ssl.conf \
|
||||
/etc/httpd/conf.d/autoindex.conf \
|
||||
/etc/httpd/conf.d/php.conf \
|
||||
/etc/httpd/conf.d/userdir.conf \
|
||||
/etc/httpd/conf.d/welcome.conf \
|
||||
/etc/php-fpm.d/www.conf && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
awk "/display/ && /true/ {gsub(/^[ \t]+|[ \t]+$/, \"\", \$0); print \$0}" "${ZABBIX_WWW_ROOT}/include/locales.inc.php" | \
|
||||
cut -d"'" -f 2 | sort -u | \
|
||||
xargs -r -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/ \
|
||||
${ZABBIX_WWW_ROOT}/include/defines.inc.php \
|
||||
${ZABBIX_WWW_ROOT}/modules/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ \
|
||||
/etc/httpd/ \
|
||||
/etc/php-fpm.d/ \
|
||||
/etc/php-fpm.conf \
|
||||
/run/httpd/ \
|
||||
/var/lib/php/session/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
microdnf -y remove \
|
||||
findutils \
|
||||
glibc-locale-source \
|
||||
@@ -122,7 +133,7 @@ EXPOSE 8080/tcp 8443/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_WWW_ROOT}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
USER 1997
|
||||
|
||||
|
||||
@@ -70,23 +70,25 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
gzip \
|
||||
supervisor" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo="baseos" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:ol-${ZBX_VERSION}
|
||||
|
||||
FROM ${BUILD_BASE_IMAGE} AS builder
|
||||
FROM builder AS clean_builder
|
||||
|
||||
ARG ZBX_VERSION
|
||||
|
||||
RUN set -eux && \
|
||||
rm -rf \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/tests" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php.example" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/maintenance.inc.php" && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.po' -delete && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.sh' -delete
|
||||
|
||||
FROM ${OS_BASE_IMAGE}
|
||||
|
||||
@@ -13,10 +25,11 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix" \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_WWW_ROOT="/usr/share/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_WWW_ROOT=/usr/share/zabbix
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \
|
||||
@@ -30,9 +43,9 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "${ZABBIX_WWW_ROOT}"]
|
||||
COPY ["conf/etc/", "/etc/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=clean_builder /tmp/zabbix-${ZBX_VERSION}/ui ${ZABBIX_WWW_ROOT}/
|
||||
COPY conf/etc/ /etc/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -78,38 +91,36 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
rm -f "/etc/httpd/conf.d/default.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/ssl.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/autoindex.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/php.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/userdir.conf" && \
|
||||
rm -f "/etc/httpd/conf.d/welcome.conf" && \
|
||||
rm -f /etc/php-fpm.d/www.conf && \
|
||||
find /etc/ -name '*.rpmnew' | xargs rm -f && \
|
||||
cd ${ZABBIX_WWW_ROOT}/ && \
|
||||
rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \
|
||||
rm -rf tests && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
cat ${ZABBIX_WWW_ROOT}/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
|
||||
cut -d"'" -f 2 | sort | \
|
||||
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_USER_HOME_DIR}/ /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
|
||||
chgrp -R 0 ${ZABBIX_USER_HOME_DIR}/ /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
|
||||
chmod -R g=u ${ZABBIX_USER_HOME_DIR}/ /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
|
||||
chown --quiet -R zabbix:root /run/httpd/ /var/lib/php/session/ && \
|
||||
chgrp -R 0 /run/httpd/ /var/lib/php/session/ && \
|
||||
chmod -R g=u /run/httpd/ /var/lib/php/session/ && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_CONF_DIR}/web \
|
||||
${ZABBIX_CONF_DIR}/web/certs \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
/var/lib/php/session && \
|
||||
rm -rf /etc/httpd/conf.d/default.conf \
|
||||
/etc/httpd/conf.d/ssl.conf \
|
||||
/etc/httpd/conf.d/autoindex.conf \
|
||||
/etc/httpd/conf.d/php.conf \
|
||||
/etc/httpd/conf.d/userdir.conf \
|
||||
/etc/httpd/conf.d/welcome.conf \
|
||||
/etc/php-fpm.d/www.conf && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
awk "/display/ && /true/ {gsub(/^[ \t]+|[ \t]+$/, \"\", \$0); print \$0}" "${ZABBIX_WWW_ROOT}/include/locales.inc.php" | \
|
||||
cut -d"'" -f 2 | sort -u | \
|
||||
xargs -r -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/ \
|
||||
${ZABBIX_WWW_ROOT}/include/defines.inc.php \
|
||||
${ZABBIX_WWW_ROOT}/modules/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ \
|
||||
/etc/httpd/ \
|
||||
/etc/php-fpm.d/ \
|
||||
/etc/php-fpm.conf \
|
||||
/run/httpd/ \
|
||||
/var/lib/php/session/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
microdnf -y remove \
|
||||
findutils \
|
||||
glibc-locale-source \
|
||||
@@ -122,7 +133,7 @@ EXPOSE 8080/tcp 8443/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_WWW_ROOT}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
USER 1997
|
||||
|
||||
|
||||
@@ -68,23 +68,25 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
gzip \
|
||||
supervisor" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo="baseos" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION}
|
||||
|
||||
FROM ${BUILD_BASE_IMAGE} AS builder
|
||||
FROM builder AS clean_builder
|
||||
|
||||
ARG ZBX_VERSION
|
||||
|
||||
RUN set -eux && \
|
||||
rm -rf \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/tests" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php.example" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/maintenance.inc.php" && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.po' -delete && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.sh' -delete
|
||||
|
||||
FROM ${OS_BASE_IMAGE}
|
||||
|
||||
@@ -13,10 +25,11 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix" \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_WWW_ROOT="/usr/share/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_WWW_ROOT=/usr/share/zabbix
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
|
||||
@@ -30,9 +43,9 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "${ZABBIX_WWW_ROOT}"]
|
||||
COPY ["conf/etc/", "/etc/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=clean_builder /tmp/zabbix-${ZBX_VERSION}/ui ${ZABBIX_WWW_ROOT}/
|
||||
COPY conf/etc/ /etc/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -76,35 +89,33 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
mkdir -p /var/lib/php/session && \
|
||||
rm -f /etc/nginx/conf.d/*.conf && \
|
||||
rm -f /etc/php-fpm.d/www.conf && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_CONF_DIR}/web \
|
||||
${ZABBIX_CONF_DIR}/web/certs \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
/var/lib/php/session && \
|
||||
rm -rf /etc/nginx/conf.d/*.conf \
|
||||
/etc/php-fpm.d/www.conf && \
|
||||
ln -sf /dev/stdout /var/log/nginx/access.log && \
|
||||
ln -sf /dev/stderr /var/log/nginx/error.log && \
|
||||
cd ${ZABBIX_WWW_ROOT}/ && \
|
||||
rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \
|
||||
rm -rf tests && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
cat ${ZABBIX_WWW_ROOT}/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
|
||||
cut -d"'" -f 2 | sort | \
|
||||
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_USER_HOME_DIR}/ /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
|
||||
chgrp -R 0 ${ZABBIX_USER_HOME_DIR}/ /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
|
||||
chmod -R g=u ${ZABBIX_USER_HOME_DIR}/ /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
|
||||
chown --quiet -R zabbix:root /var/lib/php/session/ && \
|
||||
chgrp -R 0 /var/lib/php/session/ && \
|
||||
chmod -R g=u /var/lib/php/session/ && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
awk "/display/ && /true/ {gsub(/^[ \t]+|[ \t]+$/, \"\", \$0); print \$0}" "${ZABBIX_WWW_ROOT}/include/locales.inc.php" | \
|
||||
cut -d"'" -f 2 | sort -u | \
|
||||
xargs -r -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/ \
|
||||
${ZABBIX_WWW_ROOT}/include/defines.inc.php \
|
||||
${ZABBIX_WWW_ROOT}/modules/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ \
|
||||
/etc/nginx/ \
|
||||
/etc/php-fpm.d/ \
|
||||
/etc/php-fpm.conf \
|
||||
/var/log/nginx/ \
|
||||
/var/lib/php/session/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
microdnf -y remove \
|
||||
findutils \
|
||||
glibc-locale-source \
|
||||
@@ -117,7 +128,7 @@ EXPOSE 8080/tcp 8443/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_WWW_ROOT}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
USER 1997
|
||||
|
||||
|
||||
@@ -68,23 +68,25 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
gzip \
|
||||
supervisor" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
microdnf -y reinstall \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo="baseos" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:ol-${ZBX_VERSION}
|
||||
|
||||
FROM ${BUILD_BASE_IMAGE} AS builder
|
||||
FROM builder AS clean_builder
|
||||
|
||||
ARG ZBX_VERSION
|
||||
|
||||
RUN set -eux && \
|
||||
rm -rf \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/tests" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/zabbix.conf.php.example" \
|
||||
"/tmp/zabbix-${ZBX_VERSION}/ui/conf/maintenance.inc.php" && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.po' -delete && \
|
||||
find "/tmp/zabbix-${ZBX_VERSION}/ui/locale" -name '*.sh' -delete
|
||||
|
||||
FROM ${OS_BASE_IMAGE}
|
||||
|
||||
@@ -13,10 +25,11 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix" \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_WWW_ROOT="/usr/share/zabbix"
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_WWW_ROOT=/usr/share/zabbix
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
|
||||
@@ -30,9 +43,9 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "${ZABBIX_WWW_ROOT}"]
|
||||
COPY ["conf/etc/", "/etc/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=clean_builder /tmp/zabbix-${ZBX_VERSION}/ui ${ZABBIX_WWW_ROOT}/
|
||||
COPY conf/etc/ /etc/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -40,19 +53,19 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
INSTALL_PKGS="bash \
|
||||
curl \
|
||||
gzip \
|
||||
findutils \
|
||||
glibc-locale-source \
|
||||
nginx \
|
||||
php-bcmath \
|
||||
php-curl \
|
||||
php-fpm \
|
||||
php-gd \
|
||||
php-json \
|
||||
php-ldap \
|
||||
php-mbstring \
|
||||
php-pgsql \
|
||||
php-json \
|
||||
php-xml \
|
||||
postgresql \
|
||||
findutils \
|
||||
glibc-locale-source \
|
||||
supervisor" && \
|
||||
microdnf -y install \
|
||||
--disablerepo="*" \
|
||||
@@ -76,35 +89,33 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
mkdir -p /var/lib/php/session && \
|
||||
rm -f /etc/nginx/conf.d/*.conf && \
|
||||
rm -f /etc/php-fpm.d/www.conf && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_CONF_DIR}/web \
|
||||
${ZABBIX_CONF_DIR}/web/certs \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal \
|
||||
/var/lib/php/session && \
|
||||
rm -rf /etc/nginx/conf.d/*.conf \
|
||||
/etc/php-fpm.d/www.conf && \
|
||||
ln -sf /dev/stdout /var/log/nginx/access.log && \
|
||||
ln -sf /dev/stderr /var/log/nginx/error.log && \
|
||||
cd ${ZABBIX_WWW_ROOT}/ && \
|
||||
rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \
|
||||
rm -rf tests && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.po' | xargs rm -f && \
|
||||
find ${ZABBIX_WWW_ROOT}/locale -name '*.sh' | xargs rm -f && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
cat ${ZABBIX_WWW_ROOT}/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
|
||||
cut -d"'" -f 2 | sort | \
|
||||
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chgrp -R 0 ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chmod -R g=u ${ZABBIX_CONF_DIR}/ ${ZABBIX_WWW_ROOT}/include/defines.inc.php ${ZABBIX_WWW_ROOT}/modules/ && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_USER_HOME_DIR}/ /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
|
||||
chgrp -R 0 ${ZABBIX_USER_HOME_DIR}/ /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
|
||||
chmod -R g=u ${ZABBIX_USER_HOME_DIR}/ /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
|
||||
chown --quiet -R zabbix:root /var/lib/php/session/ && \
|
||||
chgrp -R 0 /var/lib/php/session/ && \
|
||||
chmod -R g=u /var/lib/php/session/ && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "${ZABBIX_WWW_ROOT}/conf/zabbix.conf.php" && \
|
||||
ln -sf "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "${ZABBIX_WWW_ROOT}/conf/maintenance.inc.php" && \
|
||||
awk "/display/ && /true/ {gsub(/^[ \t]+|[ \t]+$/, \"\", \$0); print \$0}" "${ZABBIX_WWW_ROOT}/include/locales.inc.php" | \
|
||||
cut -d"'" -f 2 | sort -u | \
|
||||
xargs -r -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
|
||||
FIX_PERM_LIST="\
|
||||
${ZABBIX_CONF_DIR}/ \
|
||||
${ZABBIX_WWW_ROOT}/include/defines.inc.php \
|
||||
${ZABBIX_WWW_ROOT}/modules/ \
|
||||
${ZABBIX_USER_HOME_DIR}/ \
|
||||
/etc/nginx/ \
|
||||
/etc/php-fpm.d/ \
|
||||
/etc/php-fpm.conf \
|
||||
/var/log/nginx/ \
|
||||
/var/lib/php/session/" && \
|
||||
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
|
||||
chmod -R g=u ${FIX_PERM_LIST} && \
|
||||
microdnf -y remove \
|
||||
findutils \
|
||||
glibc-locale-source \
|
||||
@@ -117,7 +128,7 @@ EXPOSE 8080/tcp 8443/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_WWW_ROOT}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
USER 1997
|
||||
|
||||
|
||||
@@ -42,21 +42,23 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
ca-certificates \
|
||||
shadow-utils" && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs epel-release && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="extras-common" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
epel-release && \
|
||||
microdnf -y install \
|
||||
--disablerepo "*" \
|
||||
--enablerepo "baseos" \
|
||||
--enablerepo "appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs ${INSTALL_PKGS} && \
|
||||
--disablerepo="*" \
|
||||
--enablerepo="baseos" \
|
||||
--enablerepo="appstream" \
|
||||
--enablerepo="epel" \
|
||||
--setopt=install_weak_deps=0 \
|
||||
--setopt=keepcache=0 \
|
||||
--best \
|
||||
--nodocs \
|
||||
${INSTALL_PKGS} && \
|
||||
groupadd \
|
||||
--system \
|
||||
--gid 1995 \
|
||||
@@ -81,7 +83,7 @@ EXPOSE 10053/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# syntax=docker/dockerfile:1.6
|
||||
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}.8
|
||||
@@ -13,9 +13,10 @@ ARG ZBX_VERSION
|
||||
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
|
||||
|
||||
ENV TERM=xterm \
|
||||
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
|
||||
ZABBIX_CONF_DIR="/etc/zabbix" \
|
||||
ZBX_VERSION=${ZBX_VERSION} \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
|
||||
ZABBIX_CONF_DIR=/etc/zabbix \
|
||||
PATH=/usr/lib64/chromium-browser:$PATH
|
||||
|
||||
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
@@ -30,9 +31,9 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/web_service/sbin/zabbix_web_service", "/usr/sbin/zabbix_web_service"]
|
||||
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/web_service/conf/", "${ZABBIX_CONF_DIR}/"]
|
||||
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/web_service/sbin/zabbix_web_service /usr/sbin/zabbix_web_service
|
||||
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/web_service/conf/ ${ZABBIX_CONF_DIR}/
|
||||
COPY conf/etc/yum.repos.d/oracle-epel-ol10.repo /etc/yum.repos.d/oracle-epel-ol10.repo
|
||||
|
||||
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--mount=type=tmpfs,target=/var/cache/yum/ \
|
||||
@@ -61,12 +62,11 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
|
||||
--shell /sbin/nologin \
|
||||
--home-dir ${ZABBIX_USER_HOME_DIR} \
|
||||
zabbix && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
|
||||
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
chown --quiet -R zabbix:root ${ZABBIX_USER_HOME_DIR}/ && \
|
||||
chgrp -R 0 ${ZABBIX_USER_HOME_DIR}/ && \
|
||||
mkdir -p ${ZABBIX_CONF_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR} \
|
||||
${ZABBIX_USER_HOME_DIR}/enc \
|
||||
${ZABBIX_USER_HOME_DIR}/enc_internal && \
|
||||
chown --quiet -R zabbix:0 ${ZABBIX_USER_HOME_DIR}/ && \
|
||||
chmod -R g=u ${ZABBIX_USER_HOME_DIR}/ && \
|
||||
/usr/sbin/zabbix_web_service -V
|
||||
|
||||
@@ -74,7 +74,7 @@ EXPOSE 10053/tcp
|
||||
|
||||
WORKDIR ${ZABBIX_USER_HOME_DIR}
|
||||
|
||||
COPY ["docker-entrypoint.sh", "/usr/bin/"]
|
||||
COPY docker-entrypoint.sh /usr/bin/
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user