Merge env variables for standard locations

This commit is contained in:
Alexey Pustovalov 2024-12-26 15:52:37 +09:00
parent 9f46a6c37c
commit a950f484ea
96 changed files with 580 additions and 583 deletions

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix" ZABBIX_CONF_DIR="/etc/zabbix"
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
@ -60,7 +61,7 @@ RUN set -eux && \
--uid 1997 \ --uid 1997 \
--ingroup zabbix \ --ingroup zabbix \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home ${ZABBIX_USER_HOME_DIR}/ \ --home ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
@ -68,6 +69,7 @@ RUN set -eux && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \ ${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix" ZABBIX_CONF_DIR="/etc/zabbix"
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
@ -73,18 +74,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--gid 1995 \ --gid 1995 \
zabbix && \ zabbix && \
useradd \ useradd \
--system --comment "Zabbix monitoring system" \ --system \
--comment "Zabbix monitoring system" \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \ ${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
@ -104,7 +107,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
EXPOSE 10050/TCP EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix" ZABBIX_CONF_DIR="/etc/zabbix"
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
@ -67,12 +68,13 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \ ${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \

View File

@ -18,7 +18,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix" ZABBIX_CONF_DIR="/etc/zabbix"
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ LABEL description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
maintainer="alexey.pustovalov@zabbix.com" \ maintainer="alexey.pustovalov@zabbix.com" \
@ -105,12 +106,13 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \ ${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
@ -130,7 +132,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
EXPOSE 10050/TCP EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix" ZABBIX_CONF_DIR="/etc/zabbix"
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
@ -63,12 +64,13 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \ ${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/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>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
@ -67,6 +68,7 @@ RUN set -eux && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \

View File

@ -196,13 +196,13 @@ prepare_zbx_agent_config() {
prepare_zbx_agent_plugin_config() { prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files" echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null if command -v nvidia-smi 2>&1 >/dev/null
then then
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi fi
} }

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/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>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
@ -88,6 +89,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \

View File

@ -196,13 +196,13 @@ prepare_zbx_agent_config() {
prepare_zbx_agent_plugin_config() { prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files" echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null if command -v nvidia-smi 2>&1 >/dev/null
then then
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi fi
} }

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/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>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
@ -75,6 +76,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \

View File

@ -196,13 +196,13 @@ prepare_zbx_agent_config() {
prepare_zbx_agent_plugin_config() { prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files" echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null if command -v nvidia-smi 2>&1 >/dev/null
then then
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi fi
} }

View File

@ -18,7 +18,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/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 description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ LABEL description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
maintainer="alexey.pustovalov@zabbix.com" \ maintainer="alexey.pustovalov@zabbix.com" \
@ -109,6 +110,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \

View File

@ -196,13 +196,13 @@ prepare_zbx_agent_config() {
prepare_zbx_agent_plugin_config() { prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files" echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null if command -v nvidia-smi 2>&1 >/dev/null
then then
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi fi
} }

View File

@ -16,7 +16,8 @@ ENV TERM=xterm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/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>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
@ -71,6 +72,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \
chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \

View File

@ -196,13 +196,13 @@ prepare_zbx_agent_config() {
prepare_zbx_agent_plugin_config() { prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files" echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null if command -v nvidia-smi 2>&1 >/dev/null
then then
update_config_var "$ZABBIX_CONF_DIR/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu" update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi fi
} }

View File

@ -46,7 +46,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
` `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\conf\zabbix_agentd.d | Out-Null; ` New-Item -Force -ItemType directory -Path $env:ZBX_HOME\conf\zabbix_agentd.d | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\enc | Out-Null; ` New-Item -Force -ItemType directory -Path $env:ZBX_HOME\enc | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\modules | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\buffer | Out-Null; ` New-Item -Force -ItemType directory -Path $env:ZBX_HOME\buffer | Out-Null; `
` `
net accounts /MaxPWAge:unlimited; ` net accounts /MaxPWAge:unlimited; `

View File

@ -13,7 +13,9 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
PATH=${PATH}:/usr/lib/jvm/default-jvm/bin/ JAVA_HOME=/usr/lib/jvm/default-jvm PATH=${PATH}:/usr/lib/jvm/default-jvm/bin/ JAVA_HOME=/usr/lib/jvm/default-jvm \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
@ -54,19 +56,19 @@ RUN set -eux && \
--uid 1997 \ --uid 1997 \
--ingroup zabbix \ --ingroup zabbix \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home /var/lib/zabbix/ \ --home ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix/ && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \ rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \ mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/
EXPOSE 10052/TCP EXPOSE 10052/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -2,7 +2,7 @@
JAVA=${JAVA:-"/usr/bin/java"} JAVA=${JAVA:-"/usr/bin/java"}
JAVA_OPTIONS="-server $JAVA_OPTIONS" JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml" JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml"
cd /usr/sbin/zabbix_java cd /usr/sbin/zabbix_java

View File

@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then
set -o xtrace set -o xtrace
fi fi
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
prepare_java_gateway_config() { prepare_java_gateway_config() {
echo "** Preparing Zabbix Java Gateway log configuration file" echo "** Preparing Zabbix Java Gateway log configuration file"
ZBX_GATEWAY_CONFIG=$ZABBIX_ETC_DIR/zabbix_java_gateway_logback.xml ZBX_GATEWAY_CONFIG=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml
: ${ZBX_DEBUGLEVEL:="info"} : ${ZBX_DEBUGLEVEL:="info"}

View File

@ -12,7 +12,9 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} 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>" \ 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" \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
@ -53,20 +55,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix/ && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ && \
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \ rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \ mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/
EXPOSE 10052/TCP EXPOSE 10052/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -2,7 +2,7 @@
JAVA=${JAVA:-"/usr/bin/java"} JAVA=${JAVA:-"/usr/bin/java"}
JAVA_OPTIONS="-server $JAVA_OPTIONS" JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml" JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml"
cd /usr/sbin/zabbix_java cd /usr/sbin/zabbix_java

View File

@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then
set -o xtrace set -o xtrace
fi fi
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
prepare_java_gateway_config() { prepare_java_gateway_config() {
echo "** Preparing Zabbix Java Gateway log configuration file" echo "** Preparing Zabbix Java Gateway log configuration file"
ZBX_GATEWAY_CONFIG=$ZABBIX_ETC_DIR/zabbix_java_gateway_logback.xml ZBX_GATEWAY_CONFIG=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml
: ${ZBX_DEBUGLEVEL:="info"} : ${ZBX_DEBUGLEVEL:="info"}

View File

@ -12,7 +12,9 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} 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>" \ 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" \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
@ -53,20 +55,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix/ && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ && \
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \ rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \ mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/
EXPOSE 10052/TCP EXPOSE 10052/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -2,7 +2,7 @@
JAVA=${JAVA:-"/usr/bin/java"} JAVA=${JAVA:-"/usr/bin/java"}
JAVA_OPTIONS="-server $JAVA_OPTIONS" JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml" JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml"
cd /usr/sbin/zabbix_java cd /usr/sbin/zabbix_java

View File

@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then
set -o xtrace set -o xtrace
fi fi
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
prepare_java_gateway_config() { prepare_java_gateway_config() {
echo "** Preparing Zabbix Java Gateway log configuration file" echo "** Preparing Zabbix Java Gateway log configuration file"
ZBX_GATEWAY_CONFIG=$ZABBIX_ETC_DIR/zabbix_java_gateway_logback.xml ZBX_GATEWAY_CONFIG=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml
: ${ZBX_DEBUGLEVEL:="info"} : ${ZBX_DEBUGLEVEL:="info"}

View File

@ -14,7 +14,9 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ LABEL description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
maintainer="alexey.pustovalov@zabbix.com" \ maintainer="alexey.pustovalov@zabbix.com" \
@ -74,20 +76,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix/ && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ && \
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \ rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \ mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/
EXPOSE 10052/TCP EXPOSE 10052/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -2,7 +2,7 @@
JAVA=${JAVA:-"/usr/bin/java"} JAVA=${JAVA:-"/usr/bin/java"}
JAVA_OPTIONS="-server $JAVA_OPTIONS" JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml" JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml"
cd /usr/sbin/zabbix_java cd /usr/sbin/zabbix_java

View File

@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then
set -o xtrace set -o xtrace
fi fi
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
prepare_java_gateway_config() { prepare_java_gateway_config() {
echo "** Preparing Zabbix Java Gateway log configuration file" echo "** Preparing Zabbix Java Gateway log configuration file"
ZBX_GATEWAY_CONFIG=$ZABBIX_ETC_DIR/zabbix_java_gateway_logback.xml ZBX_GATEWAY_CONFIG=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml
: ${ZBX_DEBUGLEVEL:="info"} : ${ZBX_DEBUGLEVEL:="info"}

View File

@ -12,7 +12,9 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} 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>" \ 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" \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
@ -48,20 +50,20 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix/ && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ && \
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \ rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \ mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/
EXPOSE 10052/TCP EXPOSE 10052/TCP
WORKDIR /var/lib/zabbix WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -2,7 +2,7 @@
JAVA=${JAVA:-"/usr/bin/java"} JAVA=${JAVA:-"/usr/bin/java"}
JAVA_OPTIONS="-server $JAVA_OPTIONS" JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml" JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml"
cd /usr/sbin/zabbix_java cd /usr/sbin/zabbix_java

View File

@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then
set -o xtrace set -o xtrace
fi fi
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
prepare_java_gateway_config() { prepare_java_gateway_config() {
echo "** Preparing Zabbix Java Gateway log configuration file" echo "** Preparing Zabbix Java Gateway log configuration file"
ZBX_GATEWAY_CONFIG=$ZABBIX_ETC_DIR/zabbix_java_gateway_logback.xml ZBX_GATEWAY_CONFIG=$ZABBIX_CONF_DIR/zabbix_java_gateway_logback.xml
: ${ZBX_DEBUGLEVEL:="info"} : ${ZBX_DEBUGLEVEL:="info"}

View File

@ -80,15 +80,14 @@ RUN set -eux && \
--uid 1997 \ --uid 1997 \
--ingroup zabbix \ --ingroup zabbix \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home ${ZABBIX_USER_HOME_DIR}/ \ --home ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
@ -97,6 +96,7 @@ RUN set -eux && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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 -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \

View File

@ -104,11 +104,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
@ -117,6 +116,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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 -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \

View File

@ -91,11 +91,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
@ -104,6 +103,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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 -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \

View File

@ -133,11 +133,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
@ -146,6 +145,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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 -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \

View File

@ -84,15 +84,14 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR}/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
@ -101,6 +100,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/certs && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/keys && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \
mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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 -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \
chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \

View File

@ -357,7 +357,7 @@ create_db_schema_mysql() {
exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz" exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz"
apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql"
fi fi
} }

View File

@ -110,7 +110,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-G dialout \ -G dialout \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \

View File

@ -354,7 +354,7 @@ create_db_schema_mysql() {
exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz" exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz"
apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql"
fi fi
} }

View File

@ -91,7 +91,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-G dialout \ -G dialout \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \

View File

@ -354,7 +354,7 @@ create_db_schema_mysql() {
exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz" exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz"
apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql"
fi fi
} }

View File

@ -138,7 +138,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-G dialout \ -G dialout \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
chgrp zabbix /usr/bin/nmap && \ chgrp zabbix /usr/bin/nmap && \
setcap cap_net_raw+eip /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \

View File

@ -354,7 +354,7 @@ create_db_schema_mysql() {
exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz" exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz"
apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql"
fi fi
} }

View File

@ -354,7 +354,7 @@ create_db_schema_mysql() {
exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz" exec_sql_file "/usr/share/doc/zabbix-server-mysql/create.sql.gz"
apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql"
fi fi
} }

View File

@ -384,7 +384,7 @@ create_db_schema_postgresql() {
exec_sql_file "/usr/share/doc/zabbix-server-postgresql/timescaledb.sql" exec_sql_file "/usr/share/doc/zabbix-server-postgresql/timescaledb.sql"
fi fi
apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql"
fi fi
} }

View File

@ -8,7 +8,8 @@ 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 \ 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_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \
ZBX_SNMP_TRAP_USE_DNS=false ZBX_SNMP_TRAP_USE_DNS=false \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \
@ -40,21 +41,21 @@ RUN set -eux && \
--uid 1997 \ --uid 1997 \
--ingroup zabbix \ --ingroup zabbix \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home /var/lib/zabbix/ \ --home ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /var/lib/zabbix && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
touch /var/lib/net-snmp/snmptrapd.conf && \ touch /var/lib/net-snmp/snmptrapd.conf && \
chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/
EXPOSE 1162/UDP EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/ WORKDIR ${ZABBIX_USER_HOME_DIR}/snmptraps/
VOLUME ["/var/lib/zabbix/snmptraps"] VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"}

View File

@ -8,7 +8,8 @@ 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 \ 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_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \
ZBX_SNMP_TRAP_USE_DNS=false ZBX_SNMP_TRAP_USE_DNS=false \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \
@ -46,21 +47,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /var/lib/zabbix && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
touch /var/lib/net-snmp/snmptrapd.conf && \ touch /var/lib/net-snmp/snmptrapd.conf && \
chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/
EXPOSE 1162/UDP EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/ WORKDIR ${ZABBIX_USER_HOME_DIR}/snmptraps/
VOLUME ["/var/lib/zabbix/snmptraps"] VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"}

View File

@ -8,7 +8,8 @@ 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 \ 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_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \
ZBX_SNMP_TRAP_USE_DNS=false ZBX_SNMP_TRAP_USE_DNS=false \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \
@ -45,21 +46,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /var/lib/zabbix && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
touch /var/lib/net-snmp/snmptrapd.conf && \ touch /var/lib/net-snmp/snmptrapd.conf && \
chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/
EXPOSE 1162/UDP EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/ WORKDIR ${ZABBIX_USER_HOME_DIR}/snmptraps/
VOLUME ["/var/lib/zabbix/snmptraps"] VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"}

View File

@ -10,7 +10,8 @@ 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 \ 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_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \
ZBX_SNMP_TRAP_USE_DNS=false ZBX_SNMP_TRAP_USE_DNS=false \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
LABEL description="Zabbix SNMP traps receiver" \ LABEL description="Zabbix SNMP traps receiver" \
maintainer="alexey.pustovalov@zabbix.com" \ maintainer="alexey.pustovalov@zabbix.com" \
@ -85,21 +86,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p /var/lib/zabbix && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
touch /var/lib/net-snmp/snmptrapd.conf && \ touch /var/lib/net-snmp/snmptrapd.conf && \
chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/
EXPOSE 1162/UDP EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/ WORKDIR ${ZABBIX_USER_HOME_DIR}/snmptraps/
VOLUME ["/var/lib/zabbix/snmptraps"] VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"}

View File

@ -8,7 +8,8 @@ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
MIBDIRS=/var/lib/mibs/ietf:/var/lib/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ MIBDIRS=/var/lib/mibs/ietf:/var/lib/mibs/iana:/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_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \
ZBX_SNMP_TRAP_USE_DNS=false ZBX_SNMP_TRAP_USE_DNS=false \
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix SNMP traps receiver" \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \
@ -43,21 +44,21 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
download-mibs && \ download-mibs && \
mkdir -p /var/lib/zabbix && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \
chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \
chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/
EXPOSE 1162/UDP EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/ WORKDIR ${ZABBIX_USER_HOME_DIR}/snmptraps/
VOLUME ["/var/lib/zabbix/snmptraps"] VOLUME ["${ZABBIX_USER_HOME_DIR}/snmptraps"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"] COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]
COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"] COPY ["conf/etc/snmp/snmptrapd.conf", "/etc/snmp/"]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
ZABBIX_TRAPS_FILE="/var/lib/zabbix/snmptraps/snmptraps.log" ZABBIX_TRAPS_FILE="${ZABBIX_USER_HOME_DIR}/snmptraps/snmptraps.log"
ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"} ZBX_SNMP_TRAP_DATE_FORMAT=${ZBX_SNMP_TRAP_DATE_FORMAT:-"+%Y-%m-%dT%T%z"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \
@ -75,9 +76,9 @@ RUN set -eux && \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home /var/lib/zabbix/ \ --home /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f "/etc/apache2/conf.d/default.conf" && \ rm -f "/etc/apache2/conf.d/default.conf" && \
rm -f "/etc/apache2/conf.d/ssl.conf" && \ rm -f "/etc/apache2/conf.d/ssl.conf" && \
sed -ri \ sed -ri \
@ -95,11 +96,11 @@ RUN set -eux && \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/apache2/ /etc/php83/ && \ chown --quiet -R zabbix:root /etc/apache2/ /etc/php83/ && \
chgrp -R 0 /etc/apache2/ /etc/php83/ && \ chgrp -R 0 /etc/apache2/ /etc/php83/ && \
chmod -R g=u /etc/apache2/ /etc/php83/ chmod -R g=u /etc/apache2/ /etc/php83/

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -136,16 +134,16 @@ prepare_web_server() {
APACHE_SITES_DIR=/etc/apache2/conf.d APACHE_SITES_DIR=/etc/apache2/conf.d
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -218,12 +216,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \
@ -92,9 +93,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/default.conf" && \
rm -f "/etc/httpd/conf.d/ssl.conf" && \ rm -f "/etc/httpd/conf.d/ssl.conf" && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -109,14 +110,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -136,16 +134,16 @@ prepare_web_server() {
APACHE_SITES_DIR=/etc/httpd/conf.d APACHE_SITES_DIR=/etc/httpd/conf.d
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -234,12 +232,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \
@ -79,9 +80,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/default.conf" && \
rm -f "/etc/httpd/conf.d/ssl.conf" && \ rm -f "/etc/httpd/conf.d/ssl.conf" && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -96,14 +97,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -136,16 +134,16 @@ prepare_web_server() {
APACHE_SITES_DIR=/etc/httpd/conf.d APACHE_SITES_DIR=/etc/httpd/conf.d
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -234,12 +232,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \
@ -65,9 +66,9 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f /etc/apache2/sites-available/* && \ rm -f /etc/apache2/sites-available/* && \
rm -f /etc/apache2/sites-enabled/* && \ rm -f /etc/apache2/sites-enabled/* && \
/usr/sbin/a2enmod ssl && \ /usr/sbin/a2enmod ssl && \
@ -89,17 +90,17 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
mkdir -p /var/lib/locales/supported.d/ && \ mkdir -p /var/lib/locales/supported.d/ && \
rm -f /var/lib/locales/supported.d/local && \ rm -f /var/lib/locales/supported.d/local && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \
dpkg-reconfigure locales && \ dpkg-reconfigure locales && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/apache2/ /etc/php/8.3/ && \ chown --quiet -R zabbix:root /etc/apache2/ /etc/php/8.3/ && \
chgrp -R 0 /etc/apache2/ /etc/php/8.3/ && \ chgrp -R 0 /etc/apache2/ /etc/php/8.3/ && \
chmod -R g=u /etc/apache2/ /etc/php/8.3/ chmod -R g=u /etc/apache2/ /etc/php/8.3/

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -137,19 +135,19 @@ check_db_connect() {
prepare_web_server() { prepare_web_server() {
APACHE_SITES_DIR="/etc/apache2/sites-enabled" APACHE_SITES_DIR="/etc/apache2/sites-enabled"
ln -sfT "$ZABBIX_ETC_DIR/apache_envvars" "/etc/apache2/envvars" ln -sfT "$ZABBIX_CONF_DIR/apache_envvars" "/etc/apache2/envvars"
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -222,12 +220,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \
@ -74,9 +75,9 @@ RUN set -eux && \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home /var/lib/zabbix/ \ --home /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f "/etc/apache2/conf.d/default.conf" && \ rm -f "/etc/apache2/conf.d/default.conf" && \
rm -f "/etc/apache2/conf.d/ssl.conf" && \ rm -f "/etc/apache2/conf.d/ssl.conf" && \
sed -ri \ sed -ri \
@ -94,11 +95,11 @@ RUN set -eux && \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/apache2/ /etc/php83/ && \ chown --quiet -R zabbix:root /etc/apache2/ /etc/php83/ && \
chgrp -R 0 /etc/apache2/ /etc/php83/ && \ chgrp -R 0 /etc/apache2/ /etc/php83/ && \
chmod -R g=u /etc/apache2/ /etc/php83/ chmod -R g=u /etc/apache2/ /etc/php83/

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -135,16 +133,16 @@ prepare_web_server() {
APACHE_SITES_DIR=/etc/apache2/conf.d APACHE_SITES_DIR=/etc/apache2/conf.d
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -217,12 +215,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \
@ -93,9 +94,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/default.conf" && \
rm -f "/etc/httpd/conf.d/ssl.conf" && \ rm -f "/etc/httpd/conf.d/ssl.conf" && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -110,14 +111,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -135,16 +133,16 @@ prepare_web_server() {
APACHE_SITES_DIR=/etc/httpd/conf.d APACHE_SITES_DIR=/etc/httpd/conf.d
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -233,12 +231,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \
@ -80,9 +81,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/default.conf" && \
rm -f "/etc/httpd/conf.d/ssl.conf" && \ rm -f "/etc/httpd/conf.d/ssl.conf" && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -97,14 +98,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \
chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/httpd/ /etc/php-fpm.d/ /etc/php-fpm.conf && \

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -135,16 +133,16 @@ prepare_web_server() {
APACHE_SITES_DIR=/etc/httpd/conf.d APACHE_SITES_DIR=/etc/httpd/conf.d
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -233,12 +231,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \
@ -65,9 +66,9 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
rm -f /etc/apache2/sites-available/* && \ rm -f /etc/apache2/sites-available/* && \
rm -f /etc/apache2/sites-enabled/* && \ rm -f /etc/apache2/sites-enabled/* && \
/usr/sbin/a2enmod ssl && \ /usr/sbin/a2enmod ssl && \
@ -89,17 +90,17 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
mkdir -p /var/lib/locales/supported.d/ && \ mkdir -p /var/lib/locales/supported.d/ && \
rm -f /var/lib/locales/supported.d/local && \ rm -f /var/lib/locales/supported.d/local && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \
dpkg-reconfigure locales && \ dpkg-reconfigure locales && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/apache2/ /etc/php/8.3/ && \ chown --quiet -R zabbix:root /etc/apache2/ /etc/php/8.3/ && \
chgrp -R 0 /etc/apache2/ /etc/php/8.3/ && \ chgrp -R 0 /etc/apache2/ /etc/php/8.3/ && \
chmod -R g=u /etc/apache2/ /etc/php/8.3/ chmod -R g=u /etc/apache2/ /etc/php/8.3/

View File

@ -19,8 +19,6 @@ fi
: ${PHP_TZ:="Europe/Riga"} : ${PHP_TZ:="Europe/Riga"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Apache main configuration file # Apache main configuration file
@ -136,19 +134,19 @@ check_db_connect() {
prepare_web_server() { prepare_web_server() {
APACHE_SITES_DIR="/etc/apache2/sites-enabled" APACHE_SITES_DIR="/etc/apache2/sites-enabled"
ln -sfT "$ZABBIX_ETC_DIR/apache_envvars" "/etc/apache2/envvars" ln -sfT "$ZABBIX_CONF_DIR/apache_envvars" "/etc/apache2/envvars"
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then
echo "** Adding Zabbix virtual host (HTTPS)" echo "** Adding Zabbix virtual host (HTTPS)"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -225,12 +223,12 @@ prepare_zbx_web_config() {
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache.conf" "$ZABBIX_CONF_DIR/apache.conf"
if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/apache_ssl.conf" "$ZABBIX_CONF_DIR/apache_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -76,9 +77,9 @@ RUN set -eux && \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home /var/lib/zabbix/ \ --home /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -rf /etc/php83/php-fpm.d/www.conf && \ rm -rf /etc/php83/php-fpm.d/www.conf && \
rm -f /etc/nginx/http.d/*.conf && \ rm -f /etc/nginx/http.d/*.conf && \
@ -90,11 +91,11 @@ RUN set -eux && \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \
chgrp -R 0 /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \
chmod -R g=u /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -140,21 +138,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -245,21 +243,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -270,10 +268,10 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -91,9 +92,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -105,14 +106,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -140,21 +138,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -245,21 +243,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -270,10 +268,10 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -78,9 +79,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -92,14 +93,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -140,21 +138,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -245,21 +243,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -270,10 +268,10 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -14,13 +14,14 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL description="Zabbix web-interface based on Nginx web server with MySQL database support" \ LABEL description="Zabbix web-interface based on Nginx web server with MySQL database support" \
maintainer="alexey.pustovalov@zabbix.com" \ maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-web-mysql-72" \ name="zabbix/zabbix-web-mysql" \
release="${RELEASE}" \ release="${RELEASE}" \
run="docker run --name zabbix-web-nginx --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-nginx-72:${ZBX_VERSION}" \ run="docker run --name zabbix-web-nginx --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-nginx-70:${ZBX_VERSION}" \
summary="Zabbix web-interface based on Nginx web server with MySQL database support" \ summary="Zabbix web-interface based on Nginx web server with MySQL database support" \
url="https://www.zabbix.com/" \ url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \ vendor="Zabbix SIA" \
@ -31,7 +32,7 @@ LABEL description="Zabbix web-interface based on Nginx web server with MySQL dat
io.openshift.tags="zabbix,zabbix-web,mysql,nginx" \ io.openshift.tags="zabbix,zabbix-web,mysql,nginx" \
org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ org.label-schema.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
org.label-schema.docker.cmd="docker run --name zabbix-web-nginx --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-nginx-72:${ZBX_VERSION}" \ org.label-schema.docker.cmd="docker run --name zabbix-web-nginx --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-nginx-70:${ZBX_VERSION}" \
org.label-schema.license="AGPL v3.0" \ org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-web-mysql-rhel" \ org.label-schema.name="zabbix-web-mysql-rhel" \
org.label-schema.schema-version="1.0" \ org.label-schema.schema-version="1.0" \
@ -121,9 +122,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.conf.rpmnew && \ rm -f /etc/php-fpm.conf.rpmnew && \
@ -136,14 +137,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -140,21 +138,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -s "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR" ln -s "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -s "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR" ln -s "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -245,21 +243,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -270,10 +268,10 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -68,9 +69,9 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -rf /var/cache/nginx/ && \ rm -rf /var/cache/nginx/ && \
@ -84,17 +85,17 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
mkdir -p /var/lib/locales/supported.d/ && \ mkdir -p /var/lib/locales/supported.d/ && \
rm -f /var/lib/locales/supported.d/local && \ rm -f /var/lib/locales/supported.d/local && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \
dpkg-reconfigure locales && \ dpkg-reconfigure locales && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \
chgrp -R 0 /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \ chgrp -R 0 /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \
chmod -R g=u /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \ chmod -R g=u /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="www-data"} : ${DAEMON_USER:="www-data"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -140,21 +138,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -245,21 +243,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -270,10 +268,10 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
@ -75,9 +76,9 @@ RUN set -eux && \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home /var/lib/zabbix/ \ --home /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -rf /etc/php83/php-fpm.d/www.conf && \ rm -rf /etc/php83/php-fpm.d/www.conf && \
rm -f /etc/nginx/http.d/*.conf && \ rm -f /etc/nginx/http.d/*.conf && \
@ -89,11 +90,11 @@ RUN set -eux && \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \
chgrp -R 0 /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \
chmod -R g=u /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php83/php-fpm.d/ /etc/php83/php-fpm.conf && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -139,21 +137,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -244,21 +242,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -269,10 +267,10 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
@ -92,9 +93,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -106,14 +107,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -139,21 +137,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -244,21 +242,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -272,7 +270,7 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
@ -79,9 +80,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.d/www.conf && \ rm -f /etc/php-fpm.d/www.conf && \
@ -93,14 +94,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -139,21 +137,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -244,21 +242,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -272,7 +270,7 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -14,13 +14,14 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ LABEL description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
maintainer="alexey.pustovalov@zabbix.com" \ maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-web-pgsql-72" \ name="zabbix/zabbix-web-pgsql" \
release="${RELEASE}" \ release="${RELEASE}" \
run="docker run --name zabbix-web-nginx --link postgresql:pgsql-server --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-pgsql-72:${ZBX_VERSION}" \ run="docker run --name zabbix-web-nginx --link postgresql:pgsql-server --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-pgsql-70:${ZBX_VERSION}" \
summary="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ summary="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
url="https://www.zabbix.com/" \ url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \ vendor="Zabbix SIA" \
@ -31,7 +32,7 @@ LABEL description="Zabbix web-interface based on Nginx web server with PostgreSQ
io.openshift.tags="zabbix,zabbix-web,pgsql,nginx" \ io.openshift.tags="zabbix,zabbix-web,pgsql,nginx" \
org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ org.label-schema.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
org.label-schema.docker.cmd="docker run --name zabbix-web-nginx --link postgresql:pgsql-server --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-pgsql-72:${ZBX_VERSION}" \ org.label-schema.docker.cmd="docker run --name zabbix-web-nginx --link postgresql:pgsql-server --link zabbix-server:zabbix-server -p 80:80 -d registry.connect.redhat.com/zabbix/zabbix-web-pgsql-70:${ZBX_VERSION}" \
org.label-schema.license="AGPL v3.0" \ org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-web-pgsql-rhel" \ org.label-schema.name="zabbix-web-pgsql-rhel" \
org.label-schema.schema-version="1.0" \ org.label-schema.schema-version="1.0" \
@ -122,9 +123,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.conf.rpmnew && \ rm -f /etc/php-fpm.conf.rpmnew && \
@ -137,14 +138,14 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \
chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf /var/log/nginx/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="nginx"} : ${DAEMON_USER:="nginx"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -139,21 +137,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -244,21 +242,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -272,7 +270,7 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -12,7 +12,8 @@ ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \ ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_CONF_DIR="/etc/zabbix"
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \ 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" \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \
@ -68,9 +69,9 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \ --home-dir /var/lib/zabbix/ \
zabbix && \ zabbix && \
mkdir -p /etc/zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p /etc/zabbix/web && \ mkdir -p ${ZABBIX_CONF_DIR}/web && \
mkdir -p /etc/zabbix/web/certs && \ mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \
mkdir -p /var/lib/php/session && \ mkdir -p /var/lib/php/session && \
rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/nginx/conf.d/*.conf && \
rm -rf /var/cache/nginx/ && \ rm -rf /var/cache/nginx/ && \
@ -84,17 +85,17 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \ rm -f locale/add_new_language.sh locale/update_po.sh locale/make_mo.sh && \
find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \
find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
ln -s "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \
mkdir -p /var/lib/locales/supported.d/ && \ mkdir -p /var/lib/locales/supported.d/ && \
rm -f /var/lib/locales/supported.d/local && \ rm -f /var/lib/locales/supported.d/local && \
cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \
cut -d"'" -f 2 | sort | \ cut -d"'" -f 2 | sort | \
xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \
dpkg-reconfigure locales && \ dpkg-reconfigure locales && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \ chown --quiet -R zabbix:root /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \
chgrp -R 0 /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \ chgrp -R 0 /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \
chmod -R g=u /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \ chmod -R g=u /etc/nginx/ /etc/php/8.3/fpm/php-fpm.conf /etc/php/8.3/fpm/pool.d/ && \

View File

@ -22,8 +22,6 @@ fi
: ${DAEMON_USER:="www-data"} : ${DAEMON_USER:="www-data"}
# Default directories # Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory # Web interface www-root directory
ZABBIX_WWW_ROOT="/usr/share/zabbix" ZABBIX_WWW_ROOT="/usr/share/zabbix"
# Nginx main configuration file # Nginx main configuration file
@ -139,21 +137,21 @@ prepare_web_server() {
NGINX_SSL_CONFIG="/etc/ssl/nginx" NGINX_SSL_CONFIG="/etc/ssl/nginx"
if [ ! -f "/proc/net/if_inet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf"
sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
echo "** Adding Zabbix virtual host (HTTP)" echo "** Adding Zabbix virtual host (HTTP)"
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf"
else else
echo "**** Impossible to enable HTTP virtual host" echo "**** Impossible to enable HTTP virtual host"
fi fi
if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then if [ -f "$NGINX_SSL_CONFIG/ssl.crt" ] && [ -f "$NGINX_SSL_CONFIG/ssl.key" ] && [ -f "$NGINX_SSL_CONFIG/dhparam.pem" ]; then
echo "** Enable SSL support for Nginx" echo "** Enable SSL support for Nginx"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf"
else else
echo "**** Impossible to enable HTTPS virtual host" echo "**** Impossible to enable HTTPS virtual host"
fi fi
@ -244,21 +242,21 @@ prepare_zbx_web_config() {
FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1)
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"} : ${HTTP_INDEX_FILE:="index.php"}
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf" "$ZABBIX_CONF_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then
sed -i \ sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
sed -i \ sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${ENABLE_WEB_ACCESS_LOG:="true"} : ${ENABLE_WEB_ACCESS_LOG:="true"}
@ -272,7 +270,7 @@ prepare_zbx_web_config() {
"$NGINX_CONF_FILE" "$NGINX_CONF_FILE"
sed -ri \ sed -ri \
-e 's!^(\s*access_log).+\;!\1 off\;!g' \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \
"$ZABBIX_ETC_DIR/nginx_ssl.conf" "$ZABBIX_CONF_DIR/nginx_ssl.conf"
fi fi
: ${EXPOSE_WEB_SERVER_INFO:="on"} : ${EXPOSE_WEB_SERVER_INFO:="on"}

View File

@ -49,7 +49,7 @@ RUN set -eux && \
--uid 1997 \ --uid 1997 \
--ingroup zabbix \ --ingroup zabbix \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home ${ZABBIX_USER_HOME_DIR}/ \ --home ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \

View File

@ -64,7 +64,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR}/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \

View File

@ -58,7 +58,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR}/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \

View File

@ -89,7 +89,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR}/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \

View File

@ -63,7 +63,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
-g zabbix \ -g zabbix \
--uid 1997 \ --uid 1997 \
--shell /sbin/nologin \ --shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR}/ \ --home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \ zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \