Prepare to new Web configuration params support

This commit is contained in:
Alexey Pustovalov 2020-04-27 22:46:25 +03:00
parent b0fbbe56fa
commit 8664b78375
20 changed files with 326 additions and 101 deletions

View File

@ -1,4 +1,4 @@
FROM centos:centos7
FROM centos:centos8
LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
@ -17,30 +17,35 @@ RUN set -eux && \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/web && \
yum --quiet makecache && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
dejavu-sans-fonts \
curl \
httpd \
mariadb \
mod_ssl \
php \
php-fpm \
php-bcmath \
php-gd \
php-ldap \
php-mbstring \
php-mysql \
php-xml && \
php-mysqlnd \
php-json \
php-xml \
supervisor && \
rm -f "/etc/httpd/conf.d/default.conf" && \
rm -f "/etc/httpd/conf.d/ssl.conf" && \
rm -f /etc/php-fpm.d/www.conf && \
sed -ri \
-e 's!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g' \
-e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' \
"/etc/httpd/conf/httpd.conf" && \
sed -i 's/Listen 80/Listen 8080/g' /etc/httpd/conf/httpd.conf && \
yum -y clean all && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
ARG MAJOR_VERSION=5.0
ARG ZBX_VERSION=${MAJOR_VERSION}
@ -55,8 +60,10 @@ LABEL org.opencontainers.image.documentation="https://www.zabbix.com/documentati
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
yum --quiet makecache && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
glibc-locale-source && \
dnf -y install --setopt=tsflags=nodocs \
gettext \
git && \
cd /usr/share/ && \
@ -75,16 +82,17 @@ RUN set -eux && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/conf/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/conf/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/conf/ && \
chown --quiet -R zabbix:root /etc/httpd/ /etc/php.d/ /etc/php.ini && \
chgrp -R 0 /etc/httpd/ /etc/php.d/ /etc/php.ini && \
chmod -R g=u /etc/httpd/ /etc/php.d/ /etc/php.ini && \
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 && \
chown --quiet -R zabbix:root /run/httpd/ /var/lib/php/session/ && \
chgrp -R 0 /run/httpd/ /var/lib/php/session/ && \
chmod -R g=u /run/httpd/ /var/lib/php/session/ && \
yum -y history undo `yum -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
yum -y clean all && \
dnf -y history undo `dnf -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
dnf -y erase glibc-locale-source glibc-langpack-en && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
EXPOSE 8080/TCP 8443/TCP
@ -97,5 +105,3 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]
USER 1997
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]

View File

@ -0,0 +1,9 @@
include=/etc/php-fpm.d/*.conf
[global]
pid = /tmp/php-fpm.pid
error_log = /dev/fd/2
daemonize = no

View File

@ -0,0 +1,25 @@
[zabbix]
listen = /tmp/php-fpm.sock
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
slowlog = /dev/fd/1
php_admin_value[error_log] = /dev/fd/2
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
php_value[max_execution_time]= 300
php_value[memory_limit]= 128M
php_value[post_max_size]= 16M
php_value[upload_max_filesize]= 2M
php_value[max_input_time]= 300
php_value[max_input_vars]= 10000
; php_value[date.timezone]= Europe/Riga

View File

@ -1,8 +0,0 @@
max_execution_time=300
memory_limit=128M
post_max_size=16M
upload_max_filesize=2M
max_input_time=300
always_populate_raw_post_data=-1
max_input_vars=10000
; date.timezone=Europe/Riga

View File

@ -0,0 +1,30 @@
[supervisord]
nodaemon = true
[program:httpd]
command = /usr/sbin/%(program_name)s -D FOREGROUND
auto_start = true
autorestart = true
startsecs=2
startretries=3
stopsignal=TERM
stopwaitsecs=2
redirect_stderr=true
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0
[program:php-fpm]
command = /usr/sbin/%(program_name)s -F -c /etc/%(program_name)s.conf
auto_start = true
autorestart = true
startsecs=2
startretries=3
stopsignal=TERM
stopwaitsecs=2
redirect_stderr=true
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0

View File

@ -0,0 +1,35 @@
; supervisor config file
[unix_http_server]
file = /tmp/supervisor.sock ; (the path to the socket file)
chmod = 0700 ; sockef file mode (default 0700)
username = zbx
password = password
[supervisord]
logfile = /dev/stdout ; (main log file;default $CWD/supervisord.log)
pidfile = /tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP)
critical = critical
;user = zabbix
logfile_maxbytes = 0
logfile_backupcount = 0
loglevel = info
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf

View File

@ -9,6 +9,10 @@
Options FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost"
</FilesMatch>
</Directory>
<Directory "/usr/share/zabbix/conf">

View File

@ -31,6 +31,10 @@ Listen 8443
Options FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost"
</FilesMatch>
</Directory>
<Directory "/usr/share/zabbix/conf">

View File

@ -108,8 +108,9 @@ update_config_var() {
return
fi
# Escaping characters in parameter value
# Escaping characters in parameter value and name
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
@ -217,14 +218,14 @@ prepare_zbx_web_config() {
ZBX_WWW_ROOT="/usr/share/zabbix"
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
PHP_CONFIG_FILE="/etc/php.d/99-zabbix.ini"
PHP_CONFIG_FILE="/etc/php-fpm.d/zabbix.conf"
update_config_var "$PHP_CONFIG_FILE" "max_execution_time" "${ZBX_MAXEXECUTIONTIME:-"600"}"
update_config_var "$PHP_CONFIG_FILE" "memory_limit" "${ZBX_MEMORYLIMIT:-"128M"}"
update_config_var "$PHP_CONFIG_FILE" "post_max_size" "${ZBX_POSTMAXSIZE:-"16M"}"
update_config_var "$PHP_CONFIG_FILE" "upload_max_filesize" "${ZBX_UPLOADMAXFILESIZE:-"2M"}"
update_config_var "$PHP_CONFIG_FILE" "max_input_time" "${ZBX_MAXINPUTTIME:-"300"}"
update_config_var "$PHP_CONFIG_FILE" "date.timezone" "${PHP_TZ}"
update_config_var "$PHP_CONFIG_FILE" "php_value[max_execution_time]" "${ZBX_MAXEXECUTIONTIME:-"600"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[memory_limit]" "${ZBX_MEMORYLIMIT:-"128M"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[post_max_size]" "${ZBX_POSTMAXSIZE:-"16M"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[upload_max_filesize]" "${ZBX_UPLOADMAXFILESIZE:-"2M"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[max_input_time]" "${ZBX_MAXINPUTTIME:-"300"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[date.timezone]" "${PHP_TZ}"
ZBX_HISTORYSTORAGETYPES=${ZBX_HISTORYSTORAGETYPES:-"[]"}
@ -245,6 +246,12 @@ prepare_zbx_web_config() {
-e "s/{ZBX_SERVER_HOST}/${ZBX_SERVER_HOST}/g" \
-e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \
-e "s/{ZBX_SERVER_NAME}/$server_name/g" \
-e "s/{ZBX_DB_ENCRYPTION}/${ZBX_DB_ENCRYPTION:-"false"}/g" \
-e "s/{ZBX_DB_KEY_FILE}/${ZBX_DB_KEY_FILE}/g" \
-e "s/{ZBX_DB_CERT_FILE}/${ZBX_DB_CERT_FILE}/g" \
-e "s/{ZBX_DB_CA_FILE}/${ZBX_DB_CA_FILE}/g" \
-e "s/{ZBX_DB_VERIFY_HOST}/${ZBX_DB_VERIFY_HOST:-"false"}/g" \
-e "s/{ZBX_DB_CIPHER_LIST}/${ZBX_DB_CIPHER_LIST}/g" \
-e "s/{ZBX_HISTORYSTORAGEURL}/$history_storage_url/g" \
-e "s/{ZBX_HISTORYSTORAGETYPES}/$history_storage_types/g" \
"$ZBX_WEB_CONFIG"
@ -261,7 +268,6 @@ prepare_web() {
prepare_zbx_web_config
}
#################################################
echo "** Deploying Zabbix web-interface (Apache) with MySQL database"
@ -277,9 +283,9 @@ echo "########################################################"
if [ "$1" != "" ]; then
echo "** Executing '$@'"
exec "$@"
elif [ -f "/usr/sbin/httpd" ]; then
echo "** Executing HTTPD"
exec /usr/sbin/httpd -D FOREGROUND
elif [ -f "/usr/bin/supervisord" ]; then
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
else
echo "Unknown instructions. Exiting..."
exit 1

View File

@ -1,4 +1,4 @@
FROM centos:centos7
FROM centos:centos8
LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
@ -17,30 +17,35 @@ RUN set -eux && \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/web && \
yum --quiet makecache && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
dejavu-sans-fonts \
curl \
httpd \
mod_ssl \
php \
php-fpm \
php-bcmath \
php-gd \
php-ldap \
php-mbstring \
php-pgsql \
php-json \
php-xml \
postgresql && \
postgresql \
supervisor && \
rm -f "/etc/httpd/conf.d/default.conf" && \
rm -f "/etc/httpd/conf.d/ssl.conf" && \
rm -f /etc/php-fpm.d/www.conf && \
sed -ri \
-e 's!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g' \
-e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' \
"/etc/httpd/conf/httpd.conf" && \
sed -i 's/Listen 80/Listen 8080/g' /etc/httpd/conf/httpd.conf && \
yum -y clean all && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
ARG MAJOR_VERSION=5.0
ARG ZBX_VERSION=${MAJOR_VERSION}
@ -55,8 +60,10 @@ LABEL org.opencontainers.image.documentation="https://www.zabbix.com/documentati
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
yum --quiet makecache && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
glibc-locale-source && \
dnf -y install --setopt=tsflags=nodocs \
gettext \
git && \
cd /usr/share/ && \
@ -75,16 +82,17 @@ RUN set -eux && \
chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/conf/ && \
chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/conf/ && \
chmod -R g=u /etc/zabbix/ /usr/share/zabbix/conf/ && \
chown --quiet -R zabbix:root /etc/httpd/ /etc/php.d/ /etc/php.ini && \
chgrp -R 0 /etc/httpd/ /etc/php.d/ /etc/php.ini && \
chmod -R g=u /etc/httpd/ /etc/php.d/ /etc/php.ini && \
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 && \
chown --quiet -R zabbix:root /run/httpd/ /var/lib/php/session/ && \
chgrp -R 0 /run/httpd/ /var/lib/php/session/ && \
chmod -R g=u /run/httpd/ /var/lib/php/session/ && \
yum -y history undo `yum -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
yum -y clean all && \
dnf -y history undo `dnf -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
dnf -y erase glibc-locale-source && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
EXPOSE 8080/TCP 8443/TCP
@ -97,5 +105,3 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]
USER 1997
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]

View File

@ -0,0 +1,9 @@
include=/etc/php-fpm.d/*.conf
[global]
pid = /tmp/php-fpm.pid
error_log = /dev/fd/2
daemonize = no

View File

@ -0,0 +1,25 @@
[zabbix]
listen = /tmp/php-fpm.sock
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
slowlog = /dev/fd/1
php_admin_value[error_log] = /dev/fd/2
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
php_value[max_execution_time]= 300
php_value[memory_limit]= 128M
php_value[post_max_size]= 16M
php_value[upload_max_filesize]= 2M
php_value[max_input_time]= 300
php_value[max_input_vars]= 10000
; php_value[date.timezone]= Europe/Riga

View File

@ -1,8 +0,0 @@
max_execution_time=300
memory_limit=128M
post_max_size=16M
upload_max_filesize=2M
max_input_time=300
always_populate_raw_post_data=-1
max_input_vars=10000
; date.timezone=Europe/Riga

View File

@ -0,0 +1,30 @@
[supervisord]
nodaemon = true
[program:httpd]
command = /usr/sbin/%(program_name)s -D FOREGROUND
auto_start = true
autorestart = true
startsecs=2
startretries=3
stopsignal=TERM
stopwaitsecs=2
redirect_stderr=true
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0
[program:php-fpm]
command = /usr/sbin/%(program_name)s -F -c /etc/%(program_name)s.conf
auto_start = true
autorestart = true
startsecs=2
startretries=3
stopsignal=TERM
stopwaitsecs=2
redirect_stderr=true
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0

View File

@ -0,0 +1,35 @@
; supervisor config file
[unix_http_server]
file = /tmp/supervisor.sock ; (the path to the socket file)
chmod = 0700 ; sockef file mode (default 0700)
username = zbx
password = password
[supervisord]
logfile = /dev/stdout ; (main log file;default $CWD/supervisord.log)
pidfile = /tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir = /tmp ; ('AUTO' child log dir, default $TEMP)
critical = critical
;user = zabbix
logfile_maxbytes = 0
logfile_backupcount = 0
loglevel = info
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf

View File

@ -9,6 +9,10 @@
Options FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost"
</FilesMatch>
</Directory>
<Directory "/usr/share/zabbix/conf">

View File

@ -31,6 +31,10 @@ Listen 8443
Options FollowSymLinks
AllowOverride None
Require all granted
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost"
</FilesMatch>
</Directory>
<Directory "/usr/share/zabbix/conf">

View File

@ -108,13 +108,9 @@ update_config_var() {
return
fi
# Use full path to a file for TLS related configuration parameters
if [[ $var_name =~ ^TLS.*File$ ]]; then
var_value=$ZABBIX_USER_HOME_DIR/enc/$var_value
fi
# Escaping characters in parameter value
# Escaping characters in parameter value and name
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
@ -219,14 +215,14 @@ prepare_zbx_web_config() {
ZBX_WWW_ROOT="/usr/share/zabbix"
ZBX_WEB_CONFIG="$ZABBIX_ETC_DIR/web/zabbix.conf.php"
PHP_CONFIG_FILE="/etc/php.d/99-zabbix.ini"
PHP_CONFIG_FILE="/etc/php-fpm.d/zabbix.conf"
update_config_var "$PHP_CONFIG_FILE" "max_execution_time" "${ZBX_MAXEXECUTIONTIME:-"600"}"
update_config_var "$PHP_CONFIG_FILE" "memory_limit" "${ZBX_MEMORYLIMIT:-"128M"}"
update_config_var "$PHP_CONFIG_FILE" "post_max_size" "${ZBX_POSTMAXSIZE:-"16M"}"
update_config_var "$PHP_CONFIG_FILE" "upload_max_filesize" "${ZBX_UPLOADMAXFILESIZE:-"2M"}"
update_config_var "$PHP_CONFIG_FILE" "max_input_time" "${ZBX_MAXINPUTTIME:-"300"}"
update_config_var "$PHP_CONFIG_FILE" "date.timezone" "${PHP_TZ}"
update_config_var "$PHP_CONFIG_FILE" "php_value[max_execution_time]" "${ZBX_MAXEXECUTIONTIME:-"600"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[memory_limit]" "${ZBX_MEMORYLIMIT:-"128M"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[post_max_size]" "${ZBX_POSTMAXSIZE:-"16M"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[upload_max_filesize]" "${ZBX_UPLOADMAXFILESIZE:-"2M"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[max_input_time]" "${ZBX_MAXINPUTTIME:-"300"}"
update_config_var "$PHP_CONFIG_FILE" "php_value[date.timezone]" "${PHP_TZ}"
ZBX_HISTORYSTORAGETYPES=${ZBX_HISTORYSTORAGETYPES:-"[]"}
@ -247,6 +243,12 @@ prepare_zbx_web_config() {
-e "s/{ZBX_SERVER_HOST}/${ZBX_SERVER_HOST}/g" \
-e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \
-e "s/{ZBX_SERVER_NAME}/$server_name/g" \
-e "s/{ZBX_DB_ENCRYPTION}/${ZBX_DB_ENCRYPTION:-"false"}/g" \
-e "s/{ZBX_DB_KEY_FILE}/${ZBX_DB_KEY_FILE}/g" \
-e "s/{ZBX_DB_CERT_FILE}/${ZBX_DB_CERT_FILE}/g" \
-e "s/{ZBX_DB_CA_FILE}/${ZBX_DB_CA_FILE}/g" \
-e "s/{ZBX_DB_VERIFY_HOST}/${ZBX_DB_VERIFY_HOST:-"false"}/g" \
-e "s/{ZBX_DB_CIPHER_LIST}/${ZBX_DB_CIPHER_LIST}/g" \
-e "s/{ZBX_HISTORYSTORAGEURL}/$history_storage_url/g" \
-e "s/{ZBX_HISTORYSTORAGETYPES}/$history_storage_types/g" \
"$ZBX_WEB_CONFIG"
@ -263,7 +265,6 @@ prepare_web() {
prepare_zbx_web_config
}
#################################################
echo "** Deploying Zabbix web-interface (Apache) with MySQL database"
@ -279,9 +280,9 @@ echo "########################################################"
if [ "$1" != "" ]; then
echo "** Executing '$@'"
exec "$@"
elif [ -f "/usr/sbin/httpd" ]; then
echo "** Executing HTTPD"
exec /usr/sbin/httpd -D FOREGROUND
elif [ -f "/usr/bin/supervisord" ]; then
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
else
echo "Unknown instructions. Exiting..."
exit 1

View File

@ -1,4 +1,4 @@
FROM centos:centos7
FROM centos:centos8
LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
@ -17,9 +17,9 @@ RUN set -eux && \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/web && \
yum --quiet makecache && \
yum -y install epel-release && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
curl \
mariadb \
nginx \
@ -28,14 +28,15 @@ RUN set -eux && \
php-gd \
php-ldap \
php-mbstring \
php-mysql \
php-mysqlnd \
php-json \
php-xml \
supervisor && \
rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.d/www.conf && \
yum -y clean all && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
ARG MAJOR_VERSION=5.0
ARG ZBX_VERSION=${MAJOR_VERSION}
@ -50,8 +51,10 @@ LABEL org.opencontainers.image.documentation="https://www.zabbix.com/documentati
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
yum --quiet makecache && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
glibc-locale-source && \
dnf -y install --setopt=tsflags=nodocs \
gettext \
git && \
cd /usr/share/ && \
@ -73,10 +76,11 @@ RUN set -eux && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php.d/ /etc/php.ini && \
chgrp -R 0 /etc/nginx/ /etc/php.d/ /etc/php.ini && \
chmod -R g=u /etc/nginx/ /etc/php.d/ /etc/php.ini && \
yum -y history undo `yum -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
yum -y clean all && \
dnf -y history undo `dnf -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
dnf -y erase glibc-locale-source && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
EXPOSE 8080/TCP 8443/TCP

View File

@ -1,4 +1,4 @@
FROM centos:centos7
FROM centos:centos8
LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
@ -17,9 +17,9 @@ RUN set -eux && \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/web && \
yum --quiet makecache && \
yum -y install epel-release && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
supervisor \
curl \
nginx \
@ -30,12 +30,13 @@ RUN set -eux && \
php-ldap \
php-mbstring \
php-pgsql \
php-json \
php-xml && \
rm -f /etc/nginx/conf.d/*.conf && \
rm -f /etc/php-fpm.d/www.conf && \
yum -y clean all && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
ARG MAJOR_VERSION=5.0
ARG ZBX_VERSION=${MAJOR_VERSION}
@ -50,8 +51,10 @@ LABEL org.opencontainers.image.documentation="https://www.zabbix.com/documentati
COPY ["conf/etc/", "/etc/"]
RUN set -eux && \
yum --quiet makecache && \
yum -y install --setopt=tsflags=nodocs \
dnf --quiet makecache && \
dnf -y install --setopt=install_weak_deps=False --best --setopt=tsflags=nodocs \
glibc-locale-source && \
dnf -y install --setopt=tsflags=nodocs \
gettext \
git && \
cd /usr/share/ && \
@ -73,10 +76,11 @@ RUN set -eux && \
chown --quiet -R zabbix:root /etc/nginx/ /etc/php.d/ /etc/php.ini && \
chgrp -R 0 /etc/nginx/ /etc/php.d/ /etc/php.ini && \
chmod -R g=u /etc/nginx/ /etc/php.d/ /etc/php.ini && \
yum -y history undo `yum -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
yum -y clean all && \
dnf -y history undo `dnf -q history | sed -n 3p |column -t | cut -d' ' -f1` && \
dnf -y erase glibc-locale-source glibc-langpack-en && \
dnf -y clean all && \
rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \
rm -rf /etc/udev/hwdb.bin /root/.pki
rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki
EXPOSE 8080/TCP 8443/TCP