diff --git a/Dockerfiles/agent/alpine/Dockerfile b/Dockerfiles/agent/alpine/Dockerfile index a4a68f5e00..9abd9d5d4c 100644 --- a/Dockerfiles/agent/alpine/Dockerfile +++ b/Dockerfiles/agent/alpine/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/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 " \ 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 \ --ingroup zabbix \ --shell /sbin/nologin \ - --home ${ZABBIX_USER_HOME_DIR}/ \ + --home ${ZABBIX_USER_HOME_DIR} \ zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \ 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_internal && \ 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 \ ${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ diff --git a/Dockerfiles/agent/centos/Dockerfile b/Dockerfiles/agent/centos/Dockerfile index 7adfed0fd0..b84b2dc51e 100644 --- a/Dockerfiles/agent/centos/Dockerfile +++ b/Dockerfiles/agent/centos/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/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 " \ 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 \ zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ + --system \ + --comment "Zabbix monitoring system" \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \ 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.d/ \ @@ -104,7 +107,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ EXPOSE 10050/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/agent/ol/Dockerfile b/Dockerfiles/agent/ol/Dockerfile index 3547cce87f..10fb0f3ad3 100644 --- a/Dockerfiles/agent/ol/Dockerfile +++ b/Dockerfiles/agent/ol/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/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 " \ 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 \ --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \ 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.d/ \ diff --git a/Dockerfiles/agent/rhel/Dockerfile b/Dockerfiles/agent/rhel/Dockerfile index e3777fdc7f..fa26ead10c 100644 --- a/Dockerfiles/agent/rhel/Dockerfile +++ b/Dockerfiles/agent/rhel/Dockerfile @@ -18,7 +18,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/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" \ maintainer="alexey.pustovalov@zabbix.com" \ @@ -105,12 +106,13 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ --shell /sbin/nologin \ --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \ 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.d/ \ @@ -130,7 +132,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ EXPOSE 10050/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/agent/ubuntu/Dockerfile b/Dockerfiles/agent/ubuntu/Dockerfile index caa2f51eba..d907b1ce6b 100644 --- a/Dockerfiles/agent/ubuntu/Dockerfile +++ b/Dockerfiles/agent/ubuntu/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/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 " \ 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 \ --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/user_scripts && \ 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.d/ \ diff --git a/Dockerfiles/agent2/alpine/Dockerfile b/Dockerfiles/agent2/alpine/Dockerfile index 3a2cea3f6d..87815e8514 100644 --- a/Dockerfiles/agent2/alpine/Dockerfile +++ b/Dockerfiles/agent2/alpine/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_CONF_DIR="/etc/zabbix" -ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" +ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" \ + ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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_internal && \ 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 \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ diff --git a/Dockerfiles/agent2/alpine/docker-entrypoint.sh b/Dockerfiles/agent2/alpine/docker-entrypoint.sh index e255fefc59..858335b9b4 100755 --- a/Dockerfiles/agent2/alpine/docker-entrypoint.sh +++ b/Dockerfiles/agent2/alpine/docker-entrypoint.sh @@ -196,13 +196,13 @@ prepare_zbx_agent_config() { prepare_zbx_agent_plugin_config() { 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/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/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" + 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/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" if command -v nvidia-smi 2>&1 >/dev/null 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 } diff --git a/Dockerfiles/agent2/centos/Dockerfile b/Dockerfiles/agent2/centos/Dockerfile index f69f9faac5..2103e5fd22 100644 --- a/Dockerfiles/agent2/centos/Dockerfile +++ b/Dockerfiles/agent2/centos/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_CONF_DIR="/etc/zabbix" -ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" +ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" \ + ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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_internal && \ 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 \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ diff --git a/Dockerfiles/agent2/centos/docker-entrypoint.sh b/Dockerfiles/agent2/centos/docker-entrypoint.sh index e255fefc59..858335b9b4 100755 --- a/Dockerfiles/agent2/centos/docker-entrypoint.sh +++ b/Dockerfiles/agent2/centos/docker-entrypoint.sh @@ -196,13 +196,13 @@ prepare_zbx_agent_config() { prepare_zbx_agent_plugin_config() { 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/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/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" + 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/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" if command -v nvidia-smi 2>&1 >/dev/null 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 } diff --git a/Dockerfiles/agent2/ol/Dockerfile b/Dockerfiles/agent2/ol/Dockerfile index 38e679546a..73bff7a32e 100644 --- a/Dockerfiles/agent2/ol/Dockerfile +++ b/Dockerfiles/agent2/ol/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_CONF_DIR="/etc/zabbix" -ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" +ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" \ + ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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_internal && \ 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 \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ diff --git a/Dockerfiles/agent2/ol/docker-entrypoint.sh b/Dockerfiles/agent2/ol/docker-entrypoint.sh index e255fefc59..858335b9b4 100755 --- a/Dockerfiles/agent2/ol/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ol/docker-entrypoint.sh @@ -196,13 +196,13 @@ prepare_zbx_agent_config() { prepare_zbx_agent_plugin_config() { 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/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/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" + 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/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" if command -v nvidia-smi 2>&1 >/dev/null 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 } diff --git a/Dockerfiles/agent2/rhel/Dockerfile b/Dockerfiles/agent2/rhel/Dockerfile index 6371e9b68d..581e0e96ca 100644 --- a/Dockerfiles/agent2/rhel/Dockerfile +++ b/Dockerfiles/agent2/rhel/Dockerfile @@ -18,7 +18,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_CONF_DIR="/etc/zabbix" -ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" +ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" \ + ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts LABEL description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ 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_internal && \ 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 \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ diff --git a/Dockerfiles/agent2/rhel/docker-entrypoint.sh b/Dockerfiles/agent2/rhel/docker-entrypoint.sh index e255fefc59..858335b9b4 100755 --- a/Dockerfiles/agent2/rhel/docker-entrypoint.sh +++ b/Dockerfiles/agent2/rhel/docker-entrypoint.sh @@ -196,13 +196,13 @@ prepare_zbx_agent_config() { prepare_zbx_agent_plugin_config() { 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/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/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" + 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/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" if command -v nvidia-smi 2>&1 >/dev/null 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 } diff --git a/Dockerfiles/agent2/ubuntu/Dockerfile b/Dockerfiles/agent2/ubuntu/Dockerfile index 341a58c1ce..dfbf3a8910 100644 --- a/Dockerfiles/agent2/ubuntu/Dockerfile +++ b/Dockerfiles/agent2/ubuntu/Dockerfile @@ -16,7 +16,8 @@ ENV TERM=xterm \ ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ ZABBIX_CONF_DIR="/etc/zabbix" -ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" +ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR/buffer/agent2.db" \ + ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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_internal && \ 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 \ ${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \ ${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \ diff --git a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh index e255fefc59..858335b9b4 100755 --- a/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/agent2/ubuntu/docker-entrypoint.sh @@ -196,13 +196,13 @@ prepare_zbx_agent_config() { prepare_zbx_agent_plugin_config() { 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/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/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus" + 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/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" if command -v nvidia-smi 2>&1 >/dev/null 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 } diff --git a/Dockerfiles/agent2/windows/Dockerfile b/Dockerfiles/agent2/windows/Dockerfile index 7b7d4af926..f146b62794 100644 --- a/Dockerfiles/agent2/windows/Dockerfile +++ b/Dockerfiles/agent2/windows/Dockerfile @@ -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\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; ` ` net accounts /MaxPWAge:unlimited; ` diff --git a/Dockerfiles/java-gateway/alpine/Dockerfile b/Dockerfiles/java-gateway/alpine/Dockerfile index 73f321a250..2d904b4aa8 100644 --- a/Dockerfiles/java-gateway/alpine/Dockerfile +++ b/Dockerfiles/java-gateway/alpine/Dockerfile @@ -13,7 +13,9 @@ ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ 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 " \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ @@ -54,19 +56,19 @@ RUN set -eux && \ --uid 1997 \ --ingroup zabbix \ --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ + --home ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /etc/zabbix/ && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ 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 && \ - chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ + mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ EXPOSE 10052/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/java-gateway/alpine/conf/usr/sbin/zabbix_java_gateway b/Dockerfiles/java-gateway/alpine/conf/usr/sbin/zabbix_java_gateway index 00bab5546b..7d95615911 100755 --- a/Dockerfiles/java-gateway/alpine/conf/usr/sbin/zabbix_java_gateway +++ b/Dockerfiles/java-gateway/alpine/conf/usr/sbin/zabbix_java_gateway @@ -2,7 +2,7 @@ JAVA=${JAVA:-"/usr/bin/java"} 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 diff --git a/Dockerfiles/java-gateway/alpine/docker-entrypoint.sh b/Dockerfiles/java-gateway/alpine/docker-entrypoint.sh index c2bea7442f..5aaf164639 100755 --- a/Dockerfiles/java-gateway/alpine/docker-entrypoint.sh +++ b/Dockerfiles/java-gateway/alpine/docker-entrypoint.sh @@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi -# Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" - prepare_java_gateway_config() { 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"} diff --git a/Dockerfiles/java-gateway/centos/Dockerfile b/Dockerfiles/java-gateway/centos/Dockerfile index 6cf831a9b1..fc0a58b831 100644 --- a/Dockerfiles/java-gateway/centos/Dockerfile +++ b/Dockerfiles/java-gateway/centos/Dockerfile @@ -12,7 +12,9 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /etc/zabbix/ && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ 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 && \ - chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ + mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ EXPOSE 10052/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/java-gateway/centos/conf/usr/sbin/zabbix_java_gateway b/Dockerfiles/java-gateway/centos/conf/usr/sbin/zabbix_java_gateway index 00bab5546b..7d95615911 100755 --- a/Dockerfiles/java-gateway/centos/conf/usr/sbin/zabbix_java_gateway +++ b/Dockerfiles/java-gateway/centos/conf/usr/sbin/zabbix_java_gateway @@ -2,7 +2,7 @@ JAVA=${JAVA:-"/usr/bin/java"} 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 diff --git a/Dockerfiles/java-gateway/centos/docker-entrypoint.sh b/Dockerfiles/java-gateway/centos/docker-entrypoint.sh index c2bea7442f..5aaf164639 100755 --- a/Dockerfiles/java-gateway/centos/docker-entrypoint.sh +++ b/Dockerfiles/java-gateway/centos/docker-entrypoint.sh @@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi -# Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" - prepare_java_gateway_config() { 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"} diff --git a/Dockerfiles/java-gateway/ol/Dockerfile b/Dockerfiles/java-gateway/ol/Dockerfile index 0ad7b22950..2970b91d03 100644 --- a/Dockerfiles/java-gateway/ol/Dockerfile +++ b/Dockerfiles/java-gateway/ol/Dockerfile @@ -12,7 +12,9 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /etc/zabbix/ && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ 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 && \ - chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ + mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ EXPOSE 10052/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/java-gateway/ol/conf/usr/sbin/zabbix_java_gateway b/Dockerfiles/java-gateway/ol/conf/usr/sbin/zabbix_java_gateway index 00bab5546b..7d95615911 100755 --- a/Dockerfiles/java-gateway/ol/conf/usr/sbin/zabbix_java_gateway +++ b/Dockerfiles/java-gateway/ol/conf/usr/sbin/zabbix_java_gateway @@ -2,7 +2,7 @@ JAVA=${JAVA:-"/usr/bin/java"} 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 diff --git a/Dockerfiles/java-gateway/ol/docker-entrypoint.sh b/Dockerfiles/java-gateway/ol/docker-entrypoint.sh index c2bea7442f..5aaf164639 100755 --- a/Dockerfiles/java-gateway/ol/docker-entrypoint.sh +++ b/Dockerfiles/java-gateway/ol/docker-entrypoint.sh @@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi -# Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" - prepare_java_gateway_config() { 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"} diff --git a/Dockerfiles/java-gateway/rhel/Dockerfile b/Dockerfiles/java-gateway/rhel/Dockerfile index cb4361645d..fe306a6bc5 100644 --- a/Dockerfiles/java-gateway/rhel/Dockerfile +++ b/Dockerfiles/java-gateway/rhel/Dockerfile @@ -14,7 +14,9 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ maintainer="alexey.pustovalov@zabbix.com" \ @@ -74,20 +76,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /etc/zabbix/ && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ 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 && \ - chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ + mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ EXPOSE 10052/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/java-gateway/rhel/conf/usr/sbin/zabbix_java_gateway b/Dockerfiles/java-gateway/rhel/conf/usr/sbin/zabbix_java_gateway index 00bab5546b..7d95615911 100755 --- a/Dockerfiles/java-gateway/rhel/conf/usr/sbin/zabbix_java_gateway +++ b/Dockerfiles/java-gateway/rhel/conf/usr/sbin/zabbix_java_gateway @@ -2,7 +2,7 @@ JAVA=${JAVA:-"/usr/bin/java"} 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 diff --git a/Dockerfiles/java-gateway/rhel/docker-entrypoint.sh b/Dockerfiles/java-gateway/rhel/docker-entrypoint.sh index c2bea7442f..5aaf164639 100755 --- a/Dockerfiles/java-gateway/rhel/docker-entrypoint.sh +++ b/Dockerfiles/java-gateway/rhel/docker-entrypoint.sh @@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi -# Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" - prepare_java_gateway_config() { 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"} diff --git a/Dockerfiles/java-gateway/ubuntu/Dockerfile b/Dockerfiles/java-gateway/ubuntu/Dockerfile index e0deeb2b5a..67314929d6 100644 --- a/Dockerfiles/java-gateway/ubuntu/Dockerfile +++ b/Dockerfiles/java-gateway/ubuntu/Dockerfile @@ -12,7 +12,9 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /etc/zabbix/ && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ 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 && \ - chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \ - chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/ + mv /usr/sbin/zabbix_java/lib/logback-console.xml ${ZABBIX_CONF_DIR}/zabbix_java_gateway_logback.xml && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chgrp -R 0 ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ && \ + chmod -R g=u ${ZABBIX_CONF_DIR}/ /usr/sbin/zabbix_java/ EXPOSE 10052/TCP -WORKDIR /var/lib/zabbix +WORKDIR ${ZABBIX_USER_HOME_DIR} COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"] COPY ["docker-entrypoint.sh", "/usr/bin/"] diff --git a/Dockerfiles/java-gateway/ubuntu/conf/usr/sbin/zabbix_java_gateway b/Dockerfiles/java-gateway/ubuntu/conf/usr/sbin/zabbix_java_gateway index 00bab5546b..7d95615911 100755 --- a/Dockerfiles/java-gateway/ubuntu/conf/usr/sbin/zabbix_java_gateway +++ b/Dockerfiles/java-gateway/ubuntu/conf/usr/sbin/zabbix_java_gateway @@ -2,7 +2,7 @@ JAVA=${JAVA:-"/usr/bin/java"} 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 diff --git a/Dockerfiles/java-gateway/ubuntu/docker-entrypoint.sh b/Dockerfiles/java-gateway/ubuntu/docker-entrypoint.sh index c2bea7442f..5aaf164639 100755 --- a/Dockerfiles/java-gateway/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/java-gateway/ubuntu/docker-entrypoint.sh @@ -9,14 +9,10 @@ if [ "${DEBUG_MODE,,}" == "true" ]; then set -o xtrace fi -# Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" - prepare_java_gateway_config() { 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"} diff --git a/Dockerfiles/proxy-mysql/alpine/Dockerfile b/Dockerfiles/proxy-mysql/alpine/Dockerfile index 7e194fa674..cdd0ee25e2 100644 --- a/Dockerfiles/proxy-mysql/alpine/Dockerfile +++ b/Dockerfiles/proxy-mysql/alpine/Dockerfile @@ -80,15 +80,14 @@ RUN set -eux && \ --uid 1997 \ --ingroup zabbix \ --shell /sbin/nologin \ - --home ${ZABBIX_USER_HOME_DIR}/ \ + --home ${ZABBIX_USER_HOME_DIR} \ zabbix && \ chgrp zabbix /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}/enc && \ 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}/modules && \ 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/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ diff --git a/Dockerfiles/proxy-mysql/centos/Dockerfile b/Dockerfiles/proxy-mysql/centos/Dockerfile index 4b5c6d95cf..afd12408df 100644 --- a/Dockerfiles/proxy-mysql/centos/Dockerfile +++ b/Dockerfiles/proxy-mysql/centos/Dockerfile @@ -104,11 +104,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ zabbix && \ chgrp zabbix /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ 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/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ diff --git a/Dockerfiles/proxy-mysql/ol/Dockerfile b/Dockerfiles/proxy-mysql/ol/Dockerfile index 129ca9b532..b274b97df0 100644 --- a/Dockerfiles/proxy-mysql/ol/Dockerfile +++ b/Dockerfiles/proxy-mysql/ol/Dockerfile @@ -91,11 +91,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ zabbix && \ chgrp zabbix /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ 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/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ diff --git a/Dockerfiles/proxy-mysql/rhel/Dockerfile b/Dockerfiles/proxy-mysql/rhel/Dockerfile index 215baefaff..80815663c6 100644 --- a/Dockerfiles/proxy-mysql/rhel/Dockerfile +++ b/Dockerfiles/proxy-mysql/rhel/Dockerfile @@ -133,11 +133,10 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ zabbix && \ chgrp zabbix /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \ - mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/ && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \ 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/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ diff --git a/Dockerfiles/proxy-mysql/ubuntu/Dockerfile b/Dockerfiles/proxy-mysql/ubuntu/Dockerfile index b4e8162624..ccd28e281a 100644 --- a/Dockerfiles/proxy-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/proxy-mysql/ubuntu/Dockerfile @@ -84,15 +84,14 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir ${ZABBIX_USER_HOME_DIR}/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ chgrp zabbix /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}/enc && \ 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}/modules && \ 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/keys && \ mkdir -p ${ZABBIX_USER_HOME_DIR}/ssl/ssl_ca && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/zabbix_proxy_modules.conf ${ZABBIX_USER_HOME_DIR} && \ chown --quiet zabbix:root ${ZABBIX_CONF_DIR}/ && \ diff --git a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh index 3b6b4314d4..9db32a9225 100755 --- a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh @@ -357,7 +357,7 @@ create_db_schema_mysql() { 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 } diff --git a/Dockerfiles/server-mysql/centos/Dockerfile b/Dockerfiles/server-mysql/centos/Dockerfile index 1d1cdac785..9c110a7368 100644 --- a/Dockerfiles/server-mysql/centos/Dockerfile +++ b/Dockerfiles/server-mysql/centos/Dockerfile @@ -110,7 +110,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -G dialout \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ chgrp zabbix /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \ diff --git a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh index 7393e02e66..f06144ba22 100755 --- a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh @@ -354,7 +354,7 @@ create_db_schema_mysql() { 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 } diff --git a/Dockerfiles/server-mysql/ol/Dockerfile b/Dockerfiles/server-mysql/ol/Dockerfile index 27e5596724..22a2353418 100644 --- a/Dockerfiles/server-mysql/ol/Dockerfile +++ b/Dockerfiles/server-mysql/ol/Dockerfile @@ -91,7 +91,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -G dialout \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ chgrp zabbix /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \ diff --git a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh index 7393e02e66..f06144ba22 100755 --- a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh @@ -354,7 +354,7 @@ create_db_schema_mysql() { 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 } diff --git a/Dockerfiles/server-mysql/rhel/Dockerfile b/Dockerfiles/server-mysql/rhel/Dockerfile index 76c4ef42ac..e22983ca46 100644 --- a/Dockerfiles/server-mysql/rhel/Dockerfile +++ b/Dockerfiles/server-mysql/rhel/Dockerfile @@ -138,7 +138,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -G dialout \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ chgrp zabbix /usr/bin/nmap && \ setcap cap_net_raw+eip /usr/bin/nmap && \ diff --git a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh index 7393e02e66..f06144ba22 100755 --- a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh @@ -354,7 +354,7 @@ create_db_schema_mysql() { 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 } diff --git a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh index 7393e02e66..f06144ba22 100755 --- a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh @@ -354,7 +354,7 @@ create_db_schema_mysql() { 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 } diff --git a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh index 84a654f674..9ce3958e7e 100755 --- a/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-pgsql/ubuntu/docker-entrypoint.sh @@ -384,7 +384,7 @@ create_db_schema_postgresql() { exec_sql_file "/usr/share/doc/zabbix-server-postgresql/timescaledb.sql" fi - apply_db_scripts "/var/lib/zabbix/dbscripts/*.sql" + apply_db_scripts "${ZABBIX_USER_HOME_DIR}/dbscripts/*.sql" fi } diff --git a/Dockerfiles/snmptraps/alpine/Dockerfile b/Dockerfiles/snmptraps/alpine/Dockerfile index 958950aa12..5c5e9b2b62 100644 --- a/Dockerfiles/snmptraps/alpine/Dockerfile +++ b/Dockerfiles/snmptraps/alpine/Dockerfile @@ -8,7 +8,8 @@ ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ - ZBX_SNMP_TRAP_USE_DNS=false + ZBX_SNMP_TRAP_USE_DNS=false \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ @@ -40,21 +41,21 @@ RUN set -eux && \ --uid 1997 \ --ingroup zabbix \ --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ + --home ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p ${ZABBIX_USER_HOME_DIR} && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ touch /var/lib/net-snmp/snmptrapd.conf && \ - chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chmod -R g=u /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/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \ + chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ 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/snmp/snmptrapd.conf", "/etc/snmp/"] diff --git a/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh index 246d6f8ccd..fe9378fdb6 100644 --- a/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/alpine/conf/usr/sbin/zabbix_trap_handler.sh @@ -1,6 +1,6 @@ #!/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"} diff --git a/Dockerfiles/snmptraps/centos/Dockerfile b/Dockerfiles/snmptraps/centos/Dockerfile index 74b79733c7..7be6290930 100644 --- a/Dockerfiles/snmptraps/centos/Dockerfile +++ b/Dockerfiles/snmptraps/centos/Dockerfile @@ -8,7 +8,8 @@ ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ - ZBX_SNMP_TRAP_USE_DNS=false + ZBX_SNMP_TRAP_USE_DNS=false \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ @@ -46,21 +47,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p ${ZABBIX_USER_HOME_DIR} && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ touch /var/lib/net-snmp/snmptrapd.conf && \ - chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chmod -R g=u /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/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \ + chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ 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/snmp/snmptrapd.conf", "/etc/snmp/"] diff --git a/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh index 246d6f8ccd..fe9378fdb6 100644 --- a/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/centos/conf/usr/sbin/zabbix_trap_handler.sh @@ -1,6 +1,6 @@ #!/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"} diff --git a/Dockerfiles/snmptraps/ol/Dockerfile b/Dockerfiles/snmptraps/ol/Dockerfile index 19efb1c053..7ac582b1d9 100644 --- a/Dockerfiles/snmptraps/ol/Dockerfile +++ b/Dockerfiles/snmptraps/ol/Dockerfile @@ -8,7 +8,8 @@ ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ - ZBX_SNMP_TRAP_USE_DNS=false + ZBX_SNMP_TRAP_USE_DNS=false \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ @@ -45,21 +46,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p ${ZABBIX_USER_HOME_DIR} && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ touch /var/lib/net-snmp/snmptrapd.conf && \ - chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chmod -R g=u /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/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \ + chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ 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/snmp/snmptrapd.conf", "/etc/snmp/"] diff --git a/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh index 246d6f8ccd..fe9378fdb6 100644 --- a/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/ol/conf/usr/sbin/zabbix_trap_handler.sh @@ -1,6 +1,6 @@ #!/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"} diff --git a/Dockerfiles/snmptraps/rhel/Dockerfile b/Dockerfiles/snmptraps/rhel/Dockerfile index eb8ba60e4a..03e2ad4a97 100644 --- a/Dockerfiles/snmptraps/rhel/Dockerfile +++ b/Dockerfiles/snmptraps/rhel/Dockerfile @@ -10,7 +10,8 @@ ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ ZBX_SNMP_TRAP_DATE_FORMAT=+%Y-%m-%dT%T%z ZBX_SNMP_TRAP_FORMAT="\n" \ - ZBX_SNMP_TRAP_USE_DNS=false + ZBX_SNMP_TRAP_USE_DNS=false \ + ZABBIX_USER_HOME_DIR="/var/lib/zabbix" LABEL description="Zabbix SNMP traps receiver" \ maintainer="alexey.pustovalov@zabbix.com" \ @@ -85,21 +86,21 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p ${ZABBIX_USER_HOME_DIR} && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ touch /var/lib/net-snmp/snmptrapd.conf && \ - chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chmod -R g=u /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/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \ + chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ 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/snmp/snmptrapd.conf", "/etc/snmp/"] diff --git a/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh index 246d6f8ccd..fe9378fdb6 100644 --- a/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/rhel/conf/usr/sbin/zabbix_trap_handler.sh @@ -1,6 +1,6 @@ #!/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"} diff --git a/Dockerfiles/snmptraps/ubuntu/Dockerfile b/Dockerfiles/snmptraps/ubuntu/Dockerfile index 9c283621a5..6a17a8f52f 100644 --- a/Dockerfiles/snmptraps/ubuntu/Dockerfile +++ b/Dockerfiles/snmptraps/ubuntu/Dockerfile @@ -8,7 +8,8 @@ ENV TERM=xterm \ 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 \ 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 " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ @@ -43,21 +44,21 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ download-mibs && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/mibs && \ - chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \ - chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ + mkdir -p ${ZABBIX_USER_HOME_DIR} && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/snmptraps && \ + mkdir -p ${ZABBIX_USER_HOME_DIR}/mibs && \ + chown --quiet -R zabbix:root /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \ + chgrp -R 0 /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ && \ + chmod -R g=u /etc/snmp/ ${ZABBIX_USER_HOME_DIR}/ /var/tmp/ /var/run/ 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/snmp/snmptrapd.conf", "/etc/snmp/"] diff --git a/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh b/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh index 246d6f8ccd..fe9378fdb6 100644 --- a/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh +++ b/Dockerfiles/snmptraps/ubuntu/conf/usr/sbin/zabbix_trap_handler.sh @@ -1,6 +1,6 @@ #!/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"} diff --git a/Dockerfiles/web-apache-mysql/alpine/Dockerfile b/Dockerfiles/web-apache-mysql/alpine/Dockerfile index 006800e72b..a18cbce709 100644 --- a/Dockerfiles/web-apache-mysql/alpine/Dockerfile +++ b/Dockerfiles/web-apache-mysql/alpine/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f "/etc/apache2/conf.d/default.conf" && \ rm -f "/etc/apache2/conf.d/ssl.conf" && \ sed -ri \ @@ -95,11 +96,11 @@ RUN set -eux && \ 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 '*.sh' | xargs rm -f && \ - ln -s "/etc/zabbix/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" && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /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 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root /etc/apache2/ /etc/php83/ && \ chgrp -R 0 /etc/apache2/ /etc/php83/ && \ chmod -R g=u /etc/apache2/ /etc/php83/ diff --git a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh index d8beb4e41a..1147ccfd35 100755 --- a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -136,16 +134,16 @@ prepare_web_server() { APACHE_SITES_DIR=/etc/apache2/conf.d echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -218,12 +216,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-mysql/centos/Dockerfile b/Dockerfiles/web-apache-mysql/centos/Dockerfile index 0168d2f716..dd1ce662e4 100644 --- a/Dockerfiles/web-apache-mysql/centos/Dockerfile +++ b/Dockerfiles/web-apache-mysql/centos/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/ssl.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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 && \ 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 && \ diff --git a/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh index 0fcb7ee132..bdd3cac8c4 100755 --- a/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -136,16 +134,16 @@ prepare_web_server() { APACHE_SITES_DIR=/etc/httpd/conf.d echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -234,12 +232,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-mysql/ol/Dockerfile b/Dockerfiles/web-apache-mysql/ol/Dockerfile index e87f530c35..eaacc14a12 100644 --- a/Dockerfiles/web-apache-mysql/ol/Dockerfile +++ b/Dockerfiles/web-apache-mysql/ol/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/ssl.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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 && \ 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 && \ diff --git a/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh index 0fcb7ee132..bdd3cac8c4 100755 --- a/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -136,16 +134,16 @@ prepare_web_server() { APACHE_SITES_DIR=/etc/httpd/conf.d echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -234,12 +232,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile b/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile index 9edca6e98f..36ffa4ae84 100644 --- a/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f /etc/apache2/sites-available/* && \ rm -f /etc/apache2/sites-enabled/* && \ /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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ mkdir -p /var/lib/locales/supported.d/ && \ rm -f /var/lib/locales/supported.d/local && \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ dpkg-reconfigure locales && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ chgrp -R 0 /etc/apache2/ /etc/php/8.3/ && \ chmod -R g=u /etc/apache2/ /etc/php/8.3/ diff --git a/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh index 6797b0e29b..8d184e7954 100755 --- a/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -137,19 +135,19 @@ check_db_connect() { prepare_web_server() { 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)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -222,12 +220,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-pgsql/alpine/Dockerfile b/Dockerfiles/web-apache-pgsql/alpine/Dockerfile index ad9777add5..5248395fab 100644 --- a/Dockerfiles/web-apache-pgsql/alpine/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/alpine/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f "/etc/apache2/conf.d/default.conf" && \ rm -f "/etc/apache2/conf.d/ssl.conf" && \ sed -ri \ @@ -94,11 +95,11 @@ RUN set -eux && \ 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 '*.sh' | xargs rm -f && \ - ln -s "/etc/zabbix/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" && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /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 ${ZABBIX_CONF_DIR}/ /usr/share/zabbix/include/defines.inc.php /usr/share/zabbix/modules/ && \ chown --quiet -R zabbix:root /etc/apache2/ /etc/php83/ && \ chgrp -R 0 /etc/apache2/ /etc/php83/ && \ chmod -R g=u /etc/apache2/ /etc/php83/ diff --git a/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh index 65a4465f18..342a8fa7fe 100755 --- a/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -135,16 +133,16 @@ prepare_web_server() { APACHE_SITES_DIR=/etc/apache2/conf.d echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -217,12 +215,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-pgsql/centos/Dockerfile b/Dockerfiles/web-apache-pgsql/centos/Dockerfile index 6e7a070b71..30ae9ea8ee 100644 --- a/Dockerfiles/web-apache-pgsql/centos/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/centos/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/ssl.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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 && \ 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 && \ diff --git a/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh index 5a41b6cfed..e350b2f083 100755 --- a/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -135,16 +133,16 @@ prepare_web_server() { APACHE_SITES_DIR=/etc/httpd/conf.d echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -233,12 +231,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-pgsql/ol/Dockerfile b/Dockerfiles/web-apache-pgsql/ol/Dockerfile index 4ab2a0ad0d..ed57cb2ab4 100644 --- a/Dockerfiles/web-apache-pgsql/ol/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/ol/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f "/etc/httpd/conf.d/default.conf" && \ rm -f "/etc/httpd/conf.d/ssl.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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 && \ 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 && \ diff --git a/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh index 5a41b6cfed..e350b2f083 100755 --- a/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -135,16 +133,16 @@ prepare_web_server() { APACHE_SITES_DIR=/etc/httpd/conf.d echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -233,12 +231,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile b/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile index 08a3ca138a..2985f93e20 100644 --- a/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ rm -f /etc/apache2/sites-available/* && \ rm -f /etc/apache2/sites-enabled/* && \ /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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ mkdir -p /var/lib/locales/supported.d/ && \ rm -f /var/lib/locales/supported.d/local && \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ dpkg-reconfigure locales && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ chgrp -R 0 /etc/apache2/ /etc/php/8.3/ && \ chmod -R g=u /etc/apache2/ /etc/php/8.3/ diff --git a/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh index da1ef54766..1ef14e8eb9 100755 --- a/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -19,8 +19,6 @@ fi : ${PHP_TZ:="Europe/Riga"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Apache main configuration file @@ -136,19 +134,19 @@ check_db_connect() { prepare_web_server() { 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)" - if [ -f "$ZABBIX_ETC_DIR/apache.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" + if [ -f "$ZABBIX_CONF_DIR/apache.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache.conf" "$APACHE_SITES_DIR/zabbix.conf" else echo "**** Impossible to enable HTTP virtual host" fi if [ -f "/etc/ssl/apache2/ssl.crt" ] && [ -f "/etc/ssl/apache2/ssl.key" ]; then echo "** Adding Zabbix virtual host (HTTPS)" - if [ -f "$ZABBIX_ETC_DIR/apache_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/apache_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/apache_ssl.conf" "$APACHE_SITES_DIR/zabbix_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -225,12 +223,12 @@ prepare_zbx_web_config() { : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/apache_ssl.conf" + "$ZABBIX_CONF_DIR/apache_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} diff --git a/Dockerfiles/web-nginx-mysql/alpine/Dockerfile b/Dockerfiles/web-nginx-mysql/alpine/Dockerfile index 883abf6e34..1928e25867 100644 --- a/Dockerfiles/web-nginx-mysql/alpine/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/alpine/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -rf /etc/php83/php-fpm.d/www.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/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/ && \ - chgrp -R 0 /etc/zabbix/ /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/ && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /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 ${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 && \ 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 && \ diff --git a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh index efd4ec9cce..64746712d1 100755 --- a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -140,21 +138,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -245,21 +243,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -270,10 +268,10 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-mysql/centos/Dockerfile b/Dockerfiles/web-nginx-mysql/centos/Dockerfile index ee39462b2b..27758a9545 100644 --- a/Dockerfiles/web-nginx-mysql/centos/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/centos/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh index d3fc838ecb..29b50273a5 100755 --- a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -140,21 +138,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -245,21 +243,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -270,10 +268,10 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-mysql/ol/Dockerfile b/Dockerfiles/web-nginx-mysql/ol/Dockerfile index 72e5cbb514..6ab923e115 100644 --- a/Dockerfiles/web-nginx-mysql/ol/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/ol/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh index d3fc838ecb..29b50273a5 100755 --- a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -140,21 +138,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -245,21 +243,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -270,10 +268,10 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-mysql/rhel/Dockerfile b/Dockerfiles/web-nginx-mysql/rhel/Dockerfile index 69dd13978c..5cc93c478f 100644 --- a/Dockerfiles/web-nginx-mysql/rhel/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/rhel/Dockerfile @@ -14,13 +14,14 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL description="Zabbix web-interface based on Nginx web server with MySQL database support" \ maintainer="alexey.pustovalov@zabbix.com" \ - name="zabbix/zabbix-web-mysql-72" \ + name="zabbix/zabbix-web-mysql" \ 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" \ url="https://www.zabbix.com/" \ 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" \ 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.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.name="zabbix-web-mysql-rhel" \ org.label-schema.schema-version="1.0" \ @@ -121,9 +122,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ 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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh index 9ba5bcf827..1e147d0a1c 100755 --- a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -140,21 +138,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -s "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -s "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -s "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -s "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -245,21 +243,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -270,10 +268,10 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile b/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile index 3050c3e260..72fc51463a 100644 --- a/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ 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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ mkdir -p /var/lib/locales/supported.d/ && \ rm -f /var/lib/locales/supported.d/local && \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ dpkg-reconfigure locales && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh index f49e9d6d6c..5b7e209a6e 100755 --- a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="www-data"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -140,21 +138,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -245,21 +243,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -270,10 +268,10 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile b/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile index a4fa7fb55a..7b5f14a79d 100644 --- a/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -rf /etc/php83/php-fpm.d/www.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/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/ && \ - chgrp -R 0 /etc/zabbix/ /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/ && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + chown --quiet -R zabbix:root ${ZABBIX_CONF_DIR}/ /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 ${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 && \ 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 && \ diff --git a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh index b59efb7872..970a4163ac 100755 --- a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -139,21 +137,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -244,21 +242,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -269,10 +267,10 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-pgsql/centos/Dockerfile b/Dockerfiles/web-nginx-pgsql/centos/Dockerfile index c88abe6ff5..30911a8889 100644 --- a/Dockerfiles/web-nginx-pgsql/centos/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/centos/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh index b8b4efe6b6..4c54ff0161 100755 --- a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -139,21 +137,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -244,21 +242,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -272,7 +270,7 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-pgsql/ol/Dockerfile b/Dockerfiles/web-nginx-pgsql/ol/Dockerfile index 70aa2281ab..bc647ccf1f 100644 --- a/Dockerfiles/web-nginx-pgsql/ol/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/ol/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh index b8b4efe6b6..4c54ff0161 100755 --- a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -139,21 +137,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -244,21 +242,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -272,7 +270,7 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile b/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile index d184424234..d673f465e3 100644 --- a/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/rhel/Dockerfile @@ -14,13 +14,14 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ maintainer="alexey.pustovalov@zabbix.com" \ - name="zabbix/zabbix-web-pgsql-72" \ + name="zabbix/zabbix-web-pgsql" \ 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" \ url="https://www.zabbix.com/" \ 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" \ 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.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.name="zabbix-web-pgsql-rhel" \ org.label-schema.schema-version="1.0" \ @@ -122,9 +123,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ 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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.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' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}" && localedef -c -i {} -f UTF-8 {}.UTF-8 2>/dev/null' && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh index b8b4efe6b6..4c54ff0161 100755 --- a/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/rhel/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="nginx"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -139,21 +137,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -244,21 +242,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -272,7 +270,7 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile b/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile index 5c5d77a3bc..1bdb097236 100644 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile @@ -12,7 +12,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ - ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZABBIX_CONF_DIR="/etc/zabbix" LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ 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 \ --home-dir /var/lib/zabbix/ \ zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ + mkdir -p ${ZABBIX_CONF_DIR} && \ + mkdir -p ${ZABBIX_CONF_DIR}/web && \ + mkdir -p ${ZABBIX_CONF_DIR}/web/certs && \ mkdir -p /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ 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 && \ find /usr/share/zabbix/locale -name '*.po' | 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 "/etc/zabbix/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \ + ln -s "${ZABBIX_CONF_DIR}/web/maintenance.inc.php" "/usr/share/zabbix/conf/maintenance.inc.php" && \ mkdir -p /var/lib/locales/supported.d/ && \ rm -f /var/lib/locales/supported.d/local && \ cat /usr/share/zabbix/include/locales.inc.php | grep display | grep true | awk '{$1=$1};1' | \ cut -d"'" -f 2 | sort | \ xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ dpkg-reconfigure locales && \ - chown --quiet -R zabbix:root /etc/zabbix/ /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/ && \ - chmod -R g=u /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 ${ZABBIX_CONF_DIR}/ /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/ && \ 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/ && \ diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh index 8baffe32c7..8121c5b6e3 100755 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -22,8 +22,6 @@ fi : ${DAEMON_USER:="www-data"} # Default directories -# Configuration files directory -ZABBIX_ETC_DIR="/etc/zabbix" # Web interface www-root directory ZABBIX_WWW_ROOT="/usr/share/zabbix" # Nginx main configuration file @@ -139,21 +137,21 @@ prepare_web_server() { NGINX_SSL_CONFIG="/etc/ssl/nginx" if [ ! -f "/proc/net/if_inet6" ]; then - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx.conf" - sed -i '/listen \[::\]/d' "$ZABBIX_ETC_DIR/nginx_ssl.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx.conf" + sed -i '/listen \[::\]/d' "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi echo "** Adding Zabbix virtual host (HTTP)" - if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx.conf" "$NGINX_CONFD_DIR/nginx.conf" else echo "**** Impossible to enable HTTP virtual host" fi 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" - if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then - ln -sfT "$ZABBIX_ETC_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" + if [ -f "$ZABBIX_CONF_DIR/nginx_ssl.conf" ]; then + ln -sfT "$ZABBIX_CONF_DIR/nginx_ssl.conf" "$NGINX_CONFD_DIR/nginx_ssl.conf" else echo "**** Impossible to enable HTTPS virtual host" fi @@ -244,21 +242,21 @@ prepare_zbx_web_config() { FCGI_READ_TIMEOUT=$(expr ${ZBX_MAXEXECUTIONTIME} + 1) sed -i \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx.conf" + "$ZABBIX_CONF_DIR/nginx.conf" : ${HTTP_INDEX_FILE:="index.php"} sed -i \ -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 \ -e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" sed -i \ -e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${ENABLE_WEB_ACCESS_LOG:="true"} @@ -272,7 +270,7 @@ prepare_zbx_web_config() { "$NGINX_CONF_FILE" sed -ri \ -e 's!^(\s*access_log).+\;!\1 off\;!g' \ - "$ZABBIX_ETC_DIR/nginx_ssl.conf" + "$ZABBIX_CONF_DIR/nginx_ssl.conf" fi : ${EXPOSE_WEB_SERVER_INFO:="on"} diff --git a/Dockerfiles/web-service/alpine/Dockerfile b/Dockerfiles/web-service/alpine/Dockerfile index e1b51908c6..6c3e849162 100644 --- a/Dockerfiles/web-service/alpine/Dockerfile +++ b/Dockerfiles/web-service/alpine/Dockerfile @@ -49,7 +49,7 @@ RUN set -eux && \ --uid 1997 \ --ingroup zabbix \ --shell /sbin/nologin \ - --home ${ZABBIX_USER_HOME_DIR}/ \ + --home ${ZABBIX_USER_HOME_DIR} \ zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ diff --git a/Dockerfiles/web-service/centos/Dockerfile b/Dockerfiles/web-service/centos/Dockerfile index 99d9e015f0..cfaed790fb 100644 --- a/Dockerfiles/web-service/centos/Dockerfile +++ b/Dockerfiles/web-service/centos/Dockerfile @@ -64,7 +64,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir ${ZABBIX_USER_HOME_DIR}/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ diff --git a/Dockerfiles/web-service/ol/Dockerfile b/Dockerfiles/web-service/ol/Dockerfile index 90920aea70..a2d24777cb 100644 --- a/Dockerfiles/web-service/ol/Dockerfile +++ b/Dockerfiles/web-service/ol/Dockerfile @@ -58,7 +58,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir ${ZABBIX_USER_HOME_DIR}/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ diff --git a/Dockerfiles/web-service/rhel/Dockerfile b/Dockerfiles/web-service/rhel/Dockerfile index 612342169a..2130b17f8a 100644 --- a/Dockerfiles/web-service/rhel/Dockerfile +++ b/Dockerfiles/web-service/rhel/Dockerfile @@ -89,7 +89,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir ${ZABBIX_USER_HOME_DIR}/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \ diff --git a/Dockerfiles/web-service/ubuntu/Dockerfile b/Dockerfiles/web-service/ubuntu/Dockerfile index 052dcb440c..25996b3073 100644 --- a/Dockerfiles/web-service/ubuntu/Dockerfile +++ b/Dockerfiles/web-service/ubuntu/Dockerfile @@ -63,7 +63,7 @@ RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \ -g zabbix \ --uid 1997 \ --shell /sbin/nologin \ - --home-dir ${ZABBIX_USER_HOME_DIR}/ \ + --home-dir ${ZABBIX_USER_HOME_DIR} \ zabbix && \ mkdir -p ${ZABBIX_CONF_DIR} && \ mkdir -p ${ZABBIX_USER_HOME_DIR} && \