Merge branch 'trunk' of https://github.com/zabbix/zabbix-docker into trunk

This commit is contained in:
Alexey Pustovalov 2021-05-17 14:20:09 +05:00
commit 1beb35eb96
19 changed files with 69 additions and 114 deletions

View File

@ -385,6 +385,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -421,6 +421,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -381,6 +381,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -417,6 +417,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -387,6 +387,8 @@ services:
- "10053:10053" - "10053:10053"
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
deploy: deploy:
resources: resources:
limits: limits:

View File

@ -421,6 +421,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -381,6 +381,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -417,6 +417,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -377,6 +377,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -415,6 +415,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -375,6 +375,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -411,6 +411,8 @@ services:
- all - all
ports: ports:
- "10053:10053" - "10053:10053"
volumes:
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
deploy: deploy:

View File

@ -59,7 +59,6 @@ RUN set -eux && \
--prefix=/usr \ --prefix=/usr \
--sysconfdir=/etc/zabbix \ --sysconfdir=/etc/zabbix \
--prefix=/usr \ --prefix=/usr \
--enable-ipv6 \
--enable-webservice \ --enable-webservice \
--silent && \ --silent && \
make -j"$(nproc)" -s && \ make -j"$(nproc)" -s && \

View File

@ -84,43 +84,27 @@ update_config_var() {
} }
update_config_multiple_var() {
local config_path=$1
local var_name=$2
local var_value=$3
var_value="${var_value%\"}"
var_value="${var_value#\"}"
local IFS=,
local OPT_LIST=($var_value)
for value in "${OPT_LIST[@]}"; do
update_config_var $config_path $var_name $value true
done
}
prepare_zbx_web_service_config() { prepare_zbx_web_service_config() {
echo "** Preparing Zabbix web service configuration file" echo "** Preparing Zabbix web service configuration file"
ZBX_WEB_SERVICE_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf ZBX_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogType" "console" update_config_var $ZBX_CONFIG "LogType" "console"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFile" update_config_var $ZBX_CONFIG "LogFile"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFileSize" update_config_var $ZBX_CONFIG "LogFileSize"
update_config_var $ZBX_WEB_SERVICE_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}" update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
: ${ZBX_ALLOWEDIP:="zabbix-server"} : ${ZBX_ALLOWEDIP:="zabbix-server"}
update_config_var $ZBX_WEB_SERVICE_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}" update_config_var $ZBX_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "ListenPort" "${ZBX_LISTENPORT}" update_config_var $ZBX_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "Timeout" "${ZBX_TIMEOUT}" update_config_var $ZBX_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" update_config_var $ZBX_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}" update_config_var $ZBX_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}" update_config_var $ZBX_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}" update_config_var $ZBX_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
} }
prepare_web_service() { prepare_web_service() {

View File

@ -10,16 +10,6 @@ LABEL org.opencontainers.image.title="Zabbix web service" \
STOPSIGNAL SIGTERM STOPSIGNAL SIGTERM
RUN set -eux && \ RUN set -eux && \
ARCH_SUFFIX="$(arch)"; \
case "$ARCH_SUFFIX" in \
i686) export ARCH_SUFFIX='i386' ;; \
x86_64) [ -f /lib64/ld-linux-x86-64.so.2 ] && export ARCH_SUFFIX='amd64' || export ARCH_SUFFIX='i386' ;; \
aarch64) export ARCH_SUFFIX='arm64' ;; \
armv7l) export ARCH_SUFFIX='armhf' ;; \
ppc64el|ppc64le) export ARCH_SUFFIX='ppc64le' ;; \
s390x) export ARCH_SUFFIX='s390x' ;; \
*) echo "Unknown ARCH_SUFFIX=${ARCH_SUFFIX-}"; exit 1 ;; \
esac; \
groupadd --system --gid 1995 zabbix && \ groupadd --system --gid 1995 zabbix && \
useradd \ useradd \
--system --comment "Zabbix monitoring system" \ --system --comment "Zabbix monitoring system" \
@ -32,7 +22,8 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/enc && \
dnf --quiet makecache && \ dnf --quiet makecache && \
dnf -y install epel-release && \ dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
epel-release && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \ dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
chromium \ chromium \
openssl-libs \ openssl-libs \
@ -73,7 +64,6 @@ RUN set -eux && \
--prefix=/usr \ --prefix=/usr \
--sysconfdir=/etc/zabbix \ --sysconfdir=/etc/zabbix \
--prefix=/usr \ --prefix=/usr \
--enable-ipv6 \
--enable-webservice \ --enable-webservice \
--silent && \ --silent && \
make -j"$(nproc)" -s && \ make -j"$(nproc)" -s && \

View File

@ -84,43 +84,27 @@ update_config_var() {
} }
update_config_multiple_var() {
local config_path=$1
local var_name=$2
local var_value=$3
var_value="${var_value%\"}"
var_value="${var_value#\"}"
local IFS=,
local OPT_LIST=($var_value)
for value in "${OPT_LIST[@]}"; do
update_config_var $config_path $var_name $value true
done
}
prepare_zbx_web_service_config() { prepare_zbx_web_service_config() {
echo "** Preparing Zabbix web service configuration file" echo "** Preparing Zabbix web service configuration file"
ZBX_WEB_SERVICE_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf ZBX_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogType" "console" update_config_var $ZBX_CONFIG "LogType" "console"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFile" update_config_var $ZBX_CONFIG "LogFile"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFileSize" update_config_var $ZBX_CONFIG "LogFileSize"
update_config_var $ZBX_WEB_SERVICE_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}" update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
: ${ZBX_ALLOWEDIP:="zabbix-server"} : ${ZBX_ALLOWEDIP:="zabbix-server"}
update_config_var $ZBX_WEB_SERVICE_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}" update_config_var $ZBX_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "ListenPort" "${ZBX_LISTENPORT}" update_config_var $ZBX_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "Timeout" "${ZBX_TIMEOUT}" update_config_var $ZBX_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" update_config_var $ZBX_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}" update_config_var $ZBX_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}" update_config_var $ZBX_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}" update_config_var $ZBX_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
} }
prepare_web_service() { prepare_web_service() {

View File

@ -9,20 +9,9 @@ LABEL org.opencontainers.image.title="Zabbix web service" \
STOPSIGNAL SIGTERM STOPSIGNAL SIGTERM
COPY ["conf/etc/apt/sources.list.d/debian.list", "/etc/apt/sources.list.d/debian.list"]
COPY ["conf/etc/apt/preferences.d/chromium.pref", "/etc/apt/preferences.d/chromium.pref"] COPY ["conf/etc/apt/preferences.d/chromium.pref", "/etc/apt/preferences.d/chromium.pref"]
RUN set -eux && \ RUN set -eux && \
ARCH_SUFFIX="$(arch)"; \
case "$ARCH_SUFFIX" in \
i686) export ARCH_SUFFIX='i386' ;; \
x86_64) [ -f /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ] && export ARCH_SUFFIX='amd64' || export ARCH_SUFFIX='i386' ;; \
aarch64) export ARCH_SUFFIX='arm64' ;; \
armv7l) export ARCH_SUFFIX='armhf' ;; \
ppc64el|ppc64le) export ARCH_SUFFIX='ppc64le' ;; \
s390x) export ARCH_SUFFIX='s390x' ;; \
*) echo "Unknown ARCH_SUFFIX=${ARCH_SUFFIX-}"; exit 1 ;; \
esac; \
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
groupadd --system --gid 1995 zabbix && \ groupadd --system --gid 1995 zabbix && \
useradd \ useradd \
@ -35,7 +24,7 @@ RUN set -eux && \
mkdir -p /etc/zabbix && \ mkdir -p /etc/zabbix && \
mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/enc && \
apt-get -y update | true && \ apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
ca-certificates \ ca-certificates \
gnupg && \ gnupg && \
@ -43,8 +32,13 @@ RUN set -eux && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50 && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50 && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A && \
echo "deb http://deb.debian.org/debian buster main" > /etc/apt/sources.list.d/debian.list && \
echo "deb http://deb.debian.org/debian buster-updates main" >> /etc/apt/sources.list.d/debian.list && \
echo "deb http://deb.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list.d/debian.list && \
apt-get -y update && \ apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install chromium chromium-sandbox && \ DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
chromium \
chromium-sandbox && \
DEBIAN_FRONTEND=noninteractive apt-get -y purge \ DEBIAN_FRONTEND=noninteractive apt-get -y purge \
gnupg && \ gnupg && \
apt-get -y autoremove && \ apt-get -y autoremove && \
@ -84,7 +78,6 @@ RUN set -eux && \
--prefix=/usr \ --prefix=/usr \
--sysconfdir=/etc/zabbix \ --sysconfdir=/etc/zabbix \
--prefix=/usr \ --prefix=/usr \
--enable-ipv6 \
--enable-webservice \ --enable-webservice \
--silent && \ --silent && \
make -j"$(nproc)" -s && \ make -j"$(nproc)" -s && \

View File

@ -1,3 +0,0 @@
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian-security buster/updates main

View File

@ -84,43 +84,27 @@ update_config_var() {
} }
update_config_multiple_var() {
local config_path=$1
local var_name=$2
local var_value=$3
var_value="${var_value%\"}"
var_value="${var_value#\"}"
local IFS=,
local OPT_LIST=($var_value)
for value in "${OPT_LIST[@]}"; do
update_config_var $config_path $var_name $value true
done
}
prepare_zbx_web_service_config() { prepare_zbx_web_service_config() {
echo "** Preparing Zabbix web service configuration file" echo "** Preparing Zabbix web service configuration file"
ZBX_WEB_SERVICE_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf ZBX_CONFIG=$ZABBIX_ETC_DIR/zabbix_web_service.conf
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogType" "console" update_config_var $ZBX_CONFIG "LogType" "console"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFile" update_config_var $ZBX_CONFIG "LogFile"
update_config_var $ZBX_WEB_SERVICE_CONFIG "LogFileSize" update_config_var $ZBX_CONFIG "LogFileSize"
update_config_var $ZBX_WEB_SERVICE_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}" update_config_var $ZBX_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
: ${ZBX_ALLOWEDIP:="zabbix-server"} : ${ZBX_ALLOWEDIP:="zabbix-server"}
update_config_var $ZBX_WEB_SERVICE_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}" update_config_var $ZBX_CONFIG "AllowedIP" "${ZBX_ALLOWEDIP}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "ListenPort" "${ZBX_LISTENPORT}" update_config_var $ZBX_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "Timeout" "${ZBX_TIMEOUT}" update_config_var $ZBX_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}" update_config_var $ZBX_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}" update_config_var $ZBX_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}" update_config_var $ZBX_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_WEB_SERVICE_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}" update_config_var $ZBX_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
} }
prepare_web_service() { prepare_web_service() {