Updated Alpine images

This commit is contained in:
Alexey Pustovalov 2020-04-25 23:24:26 +03:00
parent ab2a7ab304
commit 9896a43ae5
9 changed files with 15 additions and 23 deletions

View File

@ -340,7 +340,7 @@ services:
zabbix-snmptraps: zabbix-snmptraps:
image: zabbix/zabbix-snmptraps:alpine-latest image: zabbix/zabbix-snmptraps:alpine-latest
ports: ports:
- "162:162/udp" - "162:1162/udp"
volumes: volumes:
- ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw
deploy: deploy:

View File

@ -372,7 +372,7 @@ services:
- alpine:3.10 - alpine:3.10
image: zabbix-snmptraps:alpine-local image: zabbix-snmptraps:alpine-local
ports: ports:
- "162:162/udp" - "162:1162/udp"
volumes: volumes:
- ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw
deploy: deploy:

View File

@ -343,7 +343,7 @@ services:
zabbix-snmptraps: zabbix-snmptraps:
image: zabbix/zabbix-snmptraps:alpine-latest image: zabbix/zabbix-snmptraps:alpine-latest
ports: ports:
- "162:162/udp" - "162:1162/udp"
volumes: volumes:
- ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw
deploy: deploy:

View File

@ -376,7 +376,7 @@ services:
- alpine:3.10 - alpine:3.10
image: zabbix-snmptraps:alpine-local image: zabbix-snmptraps:alpine-local
ports: ports:
- "162:162/udp" - "162:1162/udp"
volumes: volumes:
- ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw - ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:rw
deploy: deploy:

View File

@ -46,6 +46,7 @@ RUN set -eux && \
ls -lah && \ ls -lah && \
cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \
patch -p1 < ./patches/makefile.patch && \ patch -p1 < ./patches/makefile.patch && \
patch -p1 < ./patches/pid_location.patch && \
make -j"$(nproc)" -s && \ make -j"$(nproc)" -s && \
cp snmptrapfmthdlr /usr/sbin/snmptrapfmthdlr && \ cp snmptrapfmthdlr /usr/sbin/snmptrapfmthdlr && \
cp snmptrapfmt /usr/sbin/snmptrapfmt && \ cp snmptrapfmt /usr/sbin/snmptrapfmt && \
@ -59,14 +60,14 @@ RUN set -eux && \
"/etc/snmp/snmptrapfmt.conf" && \ "/etc/snmp/snmptrapfmt.conf" && \
rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \
rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \
chown --quiet -R zabbix:root /var/lib/zabbix/ && \ chown --quiet -R zabbix:root /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
chgrp -R 0 /var/lib/zabbix/ && \ chgrp -R 0 /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
chmod -R g=u /var/lib/zabbix/ && \ chmod -R g=u /etc/snmp/ /var/lib/zabbix/ /var/tmp/ /var/run/ && \
apk del --purge --no-network \ apk del --purge --no-network \
build-dependencies && \ build-dependencies && \
rm -rf /var/cache/apk/* rm -rf /var/cache/apk/*
EXPOSE 162/UDP EXPOSE 1162/UDP
WORKDIR /var/lib/zabbix/snmptraps/ WORKDIR /var/lib/zabbix/snmptraps/

View File

@ -17,7 +17,7 @@ stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0 stdout_logfile_maxbytes = 0
[program:snmptrapd] [program:snmptrapd]
command = /usr/sbin/%(program_name)s -m '+ALL' -M /usr/share/snmp/mibs/:/var/lib/zabbix/mibs -f -n -Lo -p /var/run/snmptrapd.pid -C -c /etc/snmp/%(program_name)s.conf command = /usr/sbin/%(program_name)s -m '+ALL' -M /usr/share/snmp/mibs/:/var/lib/zabbix/mibs -f -n -Lo -p /tmp/snmptrapd.pid -C -c /etc/snmp/%(program_name)s.conf udp:0.0.0.0:1162
auto_start = true auto_start = true
autorestart = true autorestart = true
priority = 100 priority = 100

View File

@ -146,16 +146,13 @@ update_config_multiple_var() {
# Check prerequisites for MySQL database # Check prerequisites for MySQL database
check_variables() { check_variables() {
: ${DB_SERVER_HOST:="mysql-server"}
DB_SERVER_HOST=${DB_SERVER_HOST:-"mysql-server"} : ${DB_SERVER_PORT:="3306"}
DB_SERVER_PORT=${DB_SERVER_PORT:-"3306"}
USE_DB_ROOT_USER=false USE_DB_ROOT_USER=false
CREATE_ZBX_DB_USER=false CREATE_ZBX_DB_USER=false
file_env MYSQL_USER file_env MYSQL_USER
file_env MYSQL_PASSWORD file_env MYSQL_PASSWORD
file_env MYSQL_ROOT_PASSWORD
if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD}" == "true" ]; then
echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password"
exit 1 exit 1
@ -175,16 +172,12 @@ check_variables() {
[ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true
# If root password is not specified use provided credentials # If root password is not specified use provided credentials
DB_SERVER_ROOT_USER=${DB_SERVER_ROOT_USER:-${MYSQL_USER}} : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}}....
[ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} [ "${MYSQL_ALLOW_EMPTY_PASSWORD}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}}
DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"}
DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"}
if [ "$type" == "proxy" ]; then DB_SERVER_DBNAME=${MYSQL_DATABASE:-"zabbix"}
DB_SERVER_DBNAME=${MYSQL_DATABASE:-"zabbix_proxy"}
else
DB_SERVER_DBNAME=${MYSQL_DATABASE:-"zabbix"}
fi
} }
check_db_connect() { check_db_connect() {
@ -235,7 +228,6 @@ prepare_web_server() {
fi fi
ln -sf /dev/fd/2 /var/log/nginx/error.log ln -sf /dev/fd/2 /var/log/nginx/error.log
ln -sf /dev/fd/1 /var/log/php-fpm.log
} }
clear_deploy() { clear_deploy() {

View File

@ -2,7 +2,7 @@
// Zabbix GUI configuration file. // Zabbix GUI configuration file.
global $DB; global $DB;
$DB['TYPE'] = 'MYSQL'; $DB['TYPE'] = 'POSTGRESQL';
$DB['SERVER'] = '{DB_SERVER_HOST}'; $DB['SERVER'] = '{DB_SERVER_HOST}';
$DB['PORT'] = '{DB_SERVER_PORT}'; $DB['PORT'] = '{DB_SERVER_PORT}';
$DB['DATABASE'] = '{DB_SERVER_DBNAME}'; $DB['DATABASE'] = '{DB_SERVER_DBNAME}';

View File

@ -228,7 +228,6 @@ prepare_web_server() {
fi fi
ln -sf /dev/fd/2 /var/log/nginx/error.log ln -sf /dev/fd/2 /var/log/nginx/error.log
ln -sf /dev/fd/1 /var/log/php-fpm.log
} }
clear_deploy() { clear_deploy() {