Skip to content

Commit

Permalink
Updated Alpine images
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneft committed Apr 25, 2020
1 parent 4391ef7 commit 4c27796
Show file tree
Hide file tree
Showing 18 changed files with 126 additions and 912 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
zbx_env/
zbx_env*/
12 changes: 7 additions & 5 deletions agent/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ LABEL org.opencontainers.image.title="Zabbix agent" \
STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
apk add --no-cache --clean-protected \
tini \
bash \
Expand Down Expand Up @@ -80,6 +79,9 @@ RUN set -eux && \
chown -R zabbix:zabbix /etc/zabbix/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -94,6 +96,6 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]

ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"]

USER zabbix
USER 1997

CMD ["/usr/sbin/zabbix_agentd", "--foreground", "-c", "/etc/zabbix/zabbix_agentd.conf"]
12 changes: 7 additions & 5 deletions java-gateway/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ LABEL org.opencontainers.image.title="Zabbix Java Gateway" \
STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
mkdir -p /etc/zabbix/ && \
chown --quiet -R zabbix:root /etc/zabbix && \
apk add --clean-protected --no-cache \
bash \
openjdk8-jre-base && \
Expand Down Expand Up @@ -65,6 +64,9 @@ RUN set -eux && \
rm -rf /usr/sbin/zabbix_java/lib/*.xml && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
chown --quiet -R zabbix:root /etc/zabbix/ && \
chgrp -R 0 /etc/zabbix/ && \
chmod -R g=u /etc/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -79,6 +81,6 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]

ENTRYPOINT ["docker-entrypoint.sh"]

USER zabbix
USER 1997

CMD ["/usr/sbin/zabbix_java_gateway"]
13 changes: 7 additions & 6 deletions proxy-mysql/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ LABEL org.opencontainers.image.title="Zabbix proxy (MySQL)" \
STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
mkdir -p /etc/zabbix && \
Expand All @@ -28,7 +28,6 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix/ssl/certs && \
mkdir -p /var/lib/zabbix/ssl/keys && \
mkdir -p /var/lib/zabbix/ssl/ssl_ca && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \
apk add --clean-protected --no-cache \
tini \
Expand Down Expand Up @@ -104,12 +103,14 @@ RUN set -eux && \
cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \
cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \
cp conf/zabbix_proxy.conf /etc/zabbix/zabbix_proxy.conf && \
chown --quiet -R zabbix:root /etc/zabbix && \
cat database/mysql/schema.sql > database/mysql/create.sql && \
gzip database/mysql/create.sql && \
cp database/mysql/create.sql.gz /usr/share/doc/zabbix-proxy-mysql/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -125,6 +126,6 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]

ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"]

USER zabbix
USER 1997

CMD ["/usr/sbin/zabbix_proxy", "--foreground", "-c", "/etc/zabbix/zabbix_proxy.conf"]
13 changes: 7 additions & 6 deletions proxy-sqlite3/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ LABEL org.opencontainers.image.title="Zabbix proxy (SQLite3)" \
STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
mkdir -p /etc/zabbix && \
Expand All @@ -28,7 +28,6 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix/ssl/certs && \
mkdir -p /var/lib/zabbix/ssl/keys && \
mkdir -p /var/lib/zabbix/ssl/ssl_ca && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
apk add --clean-protected --no-cache \
tini \
bash \
Expand Down Expand Up @@ -103,9 +102,11 @@ RUN set -eux && \
cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \
cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \
cp conf/zabbix_proxy.conf /etc/zabbix/zabbix_proxy.conf && \
chown --quiet -R zabbix:root /etc/zabbix && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -121,6 +122,6 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]

ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"]

USER zabbix
USER 1997

CMD ["/usr/sbin/zabbix_proxy", "--foreground", "-c", "/etc/zabbix/zabbix_proxy.conf"]
13 changes: 7 additions & 6 deletions server-mysql/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ LABEL org.opencontainers.image.title="Zabbix server (MySQL)" \
STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
adduser zabbix dialout && \
Expand All @@ -31,7 +31,6 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix/ssl/certs && \
mkdir -p /var/lib/zabbix/ssl/keys && \
mkdir -p /var/lib/zabbix/ssl/ssl_ca && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
mkdir -p /usr/share/doc/zabbix-server-mysql && \
apk add --clean-protected --no-cache \
tini \
Expand Down Expand Up @@ -109,14 +108,16 @@ RUN set -eux && \
cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \
cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \
cp conf/zabbix_server.conf /etc/zabbix/zabbix_server.conf && \
chown --quiet -R zabbix:root /etc/zabbix && \
cat database/mysql/schema.sql > database/mysql/create.sql && \
cat database/mysql/images.sql >> database/mysql/create.sql && \
cat database/mysql/data.sql >> database/mysql/create.sql && \
gzip database/mysql/create.sql && \
cp database/mysql/create.sql.gz /usr/share/doc/zabbix-server-mysql/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -132,6 +133,6 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]

ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"]

USER zabbix
USER 1997

CMD ["/usr/sbin/zabbix_server", "--foreground", "-c", "/etc/zabbix/zabbix_server.conf"]
13 changes: 7 additions & 6 deletions server-pgsql/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ LABEL org.opencontainers.image.title="Zabbix server (PostgreSQL)" \
STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
adduser zabbix dialout && \
Expand All @@ -31,7 +31,6 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix/ssl/certs && \
mkdir -p /var/lib/zabbix/ssl/keys && \
mkdir -p /var/lib/zabbix/ssl/ssl_ca && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
mkdir -p /usr/share/doc/zabbix-server-postgresql && \
apk add --clean-protected --no-cache \
tini \
Expand Down Expand Up @@ -110,14 +109,16 @@ RUN set -eux && \
cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \
cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \
cp conf/zabbix_server.conf /etc/zabbix/zabbix_server.conf && \
chown --quiet -R zabbix:root /etc/zabbix && \
cat database/postgresql/schema.sql > database/postgresql/create.sql && \
cat database/postgresql/images.sql >> database/postgresql/create.sql && \
cat database/postgresql/data.sql >> database/postgresql/create.sql && \
gzip database/postgresql/create.sql && \
cp database/postgresql/create.sql.gz /usr/share/doc/zabbix-server-postgresql/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -133,6 +134,6 @@ COPY ["docker-entrypoint.sh", "/usr/bin/"]

ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"]

USER zabbix
USER 1997

CMD ["/usr/sbin/zabbix_server", "--foreground", "-c", "/etc/zabbix/zabbix_server.conf"]
18 changes: 10 additions & 8 deletions snmptraps/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM alpine:3.11

ARG APK_FLAGS_PERSISTENT="--clean-protected --no-cache"
ARG APK_FLAGS_DEV="--no-cache"

ARG MAJOR_VERSION=master
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
Expand All @@ -25,16 +22,17 @@ STOPSIGNAL SIGTERM
COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"]

RUN set -eux && \
addgroup zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
zabbix && \
apk update && \
apk add ${APK_FLAGS_PERSISTENT} \
apk add --clean-protected --no-cache \
net-snmp \
supervisor && \
apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
apk add --no-cache --virtual build-dependencies \
alpine-sdk \
autoconf \
automake \
Expand All @@ -43,7 +41,6 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/snmptraps && \
mkdir -p /var/lib/zabbix/mibs && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
cd /tmp/ && \
tar -zxvf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \
ls -lah && \
Expand All @@ -62,6 +59,9 @@ RUN set -eux && \
"/etc/snmp/snmptrapfmt.conf" && \
rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \
rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \
chown --quiet -R zabbix:root /var/lib/zabbix/ && \
chgrp -R 0 /var/lib/zabbix/ && \
chmod -R g=u /var/lib/zabbix/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -75,4 +75,6 @@ VOLUME ["/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
COPY ["conf/etc/supervisor/", "/etc/supervisor/"]
COPY ["conf/etc/logrotate.d/zabbix_snmptraps", "/etc/logrotate.d/"]

USER 1997

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
23 changes: 14 additions & 9 deletions web-apache-mysql/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.vendor="Zabbix LLC" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.description="abbix web-interface based on Apache2 web server with MySQL database support" \
org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \
org.opencontainers.image.licenses="GPL v2.0"

STOPSIGNAL SIGTERM

RUN set -eux && \
addgroup -S -g 1000 zabbix && \
addgroup -S -g 1995 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-D -G zabbix -G root \
-u 1997 \
-h /var/lib/zabbix/ \
-H \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/web && \
chown --quiet -R zabbix:root /etc/zabbix && \
apk add --clean-protected --no-cache \
apache2 \
bash \
Expand Down Expand Up @@ -64,6 +63,8 @@ LABEL org.opencontainers.image.documentation="https://www.zabbix.com/documentati
org.opencontainers.image.version="${ZBX_VERSION}" \
org.opencontainers.image.source="${ZBX_SOURCES}"

COPY ["conf/etc/", "/etc/"]

RUN set -eux && \
apk add --no-cache --virtual build-dependencies \
gettext \
Expand All @@ -78,6 +79,12 @@ RUN set -eux && \
rm -rf tests && \
./locale/make_mo.sh && \
ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" && \
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/apache2/ /etc/php7/ && \
chgrp -R 0 /etc/apache2/ /etc/php7/ && \
chmod -R g=u /etc/apache2/ /etc/php7/ && \
apk del --purge --no-network \
build-dependencies && \
rm -rf /var/cache/apk/*
Expand All @@ -88,12 +95,10 @@ WORKDIR /usr/share/zabbix

VOLUME ["/etc/ssl/apache2"]

COPY ["conf/etc/zabbix/apache.conf", "/etc/zabbix/"]
COPY ["conf/etc/zabbix/apache_ssl.conf", "/etc/zabbix/"]
COPY ["conf/etc/zabbix/web/zabbix.conf.php", "/etc/zabbix/web/"]
COPY ["conf/etc/php7/conf.d/99-zabbix.ini", "/etc/php7/conf.d/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"]

USER 1997

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
1 change: 0 additions & 1 deletion web-apache-mysql/alpine/conf/etc/php7/conf.d/99-zabbix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ max_input_time=300
; always_populate_raw_post_data=-1
max_input_vars=10000
; date.timezone=Europe/Riga
; session.save_path=/var/lib/php5
Loading

0 comments on commit 4c27796

Please sign in to comment.