From 93cbd3d82658b7e4e4cf2586e3a634a2b8a1f371 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sat, 16 Oct 2021 11:49:19 -0400 Subject: [PATCH] Minor design changes --- Dockerfiles/agent/alpine/Dockerfile | 51 +++++---- Dockerfiles/agent/alpine/hooks/build | 13 --- Dockerfiles/agent/centos/Dockerfile | 57 +++++----- Dockerfiles/agent/centos/hooks/build | 13 --- Dockerfiles/agent/ol/Dockerfile | 61 +++++----- Dockerfiles/agent/ol/hooks/build | 13 --- Dockerfiles/agent/rhel/Dockerfile | 60 +++++----- Dockerfiles/agent/rhel/hooks/build | 13 --- Dockerfiles/agent/ubuntu/Dockerfile | 52 +++++---- Dockerfiles/agent/ubuntu/hooks/build | 13 --- Dockerfiles/agent/windows/Dockerfile | 6 +- Dockerfiles/agent2/alpine/Dockerfile | 47 ++++---- Dockerfiles/agent2/alpine/hooks/build | 13 --- Dockerfiles/agent2/centos/Dockerfile | 53 ++++----- Dockerfiles/agent2/centos/hooks/build | 13 --- Dockerfiles/agent2/ol/Dockerfile | 63 ++++++----- Dockerfiles/agent2/ol/hooks/build | 13 --- Dockerfiles/agent2/rhel/Dockerfile | 65 ++++++----- Dockerfiles/agent2/rhel/hooks/build | 13 --- Dockerfiles/agent2/ubuntu/Dockerfile | 49 +++++---- Dockerfiles/agent2/ubuntu/hooks/build | 13 --- Dockerfiles/agent2/windows/Dockerfile | 6 +- Dockerfiles/build-base/alpine/Dockerfile | 26 +++-- Dockerfiles/build-base/centos/Dockerfile | 34 +++--- Dockerfiles/build-base/ol/Dockerfile | 21 ++-- Dockerfiles/build-base/rhel/Dockerfile | 49 ++++----- Dockerfiles/build-base/ubuntu/Dockerfile | 27 ++--- .../build-base/windows/Dockerfile.agent | 7 +- .../build-base/windows/Dockerfile.agent2 | 7 +- Dockerfiles/build-mysql/alpine/Dockerfile | 24 ++-- Dockerfiles/build-mysql/centos/Dockerfile | 23 ++-- Dockerfiles/build-mysql/ol/Dockerfile | 23 ++-- Dockerfiles/build-mysql/rhel/Dockerfile | 28 +++-- Dockerfiles/build-mysql/ubuntu/Dockerfile | 24 ++-- .../build-mysql/windows/Dockerfile.agent | 3 +- .../build-mysql/windows/Dockerfile.agent2 | 1 - Dockerfiles/build-pgsql/alpine/Dockerfile | 24 ++-- Dockerfiles/build-pgsql/centos/Dockerfile | 24 ++-- Dockerfiles/build-pgsql/ol/Dockerfile | 24 ++-- Dockerfiles/build-pgsql/ubuntu/Dockerfile | 24 ++-- Dockerfiles/build-sqlite3/alpine/Dockerfile | 24 ++-- Dockerfiles/build-sqlite3/centos/Dockerfile | 23 ++-- Dockerfiles/build-sqlite3/ol/Dockerfile | 23 ++-- Dockerfiles/build-sqlite3/rhel/Dockerfile | 24 ++-- Dockerfiles/build-sqlite3/ubuntu/Dockerfile | 24 ++-- Dockerfiles/java-gateway/alpine/Dockerfile | 37 ++++--- Dockerfiles/java-gateway/centos/Dockerfile | 52 +++++---- Dockerfiles/java-gateway/ol/Dockerfile | 51 +++++---- Dockerfiles/java-gateway/rhel/Dockerfile | 50 +++++---- Dockerfiles/java-gateway/ubuntu/Dockerfile | 44 +++++--- Dockerfiles/proxy-mysql/alpine/Dockerfile | 79 +++++++------ Dockerfiles/proxy-mysql/centos/Dockerfile | 78 ++++++------- Dockerfiles/proxy-mysql/ol/Dockerfile | 79 ++++++------- Dockerfiles/proxy-mysql/rhel/Dockerfile | 68 +++++++----- Dockerfiles/proxy-mysql/ubuntu/Dockerfile | 73 ++++++------ Dockerfiles/proxy-sqlite3/alpine/Dockerfile | 62 ++++++----- Dockerfiles/proxy-sqlite3/centos/Dockerfile | 76 +++++++------ Dockerfiles/proxy-sqlite3/ol/Dockerfile | 79 ++++++------- Dockerfiles/proxy-sqlite3/rhel/Dockerfile | 68 +++++++----- Dockerfiles/proxy-sqlite3/ubuntu/Dockerfile | 72 ++++++------ Dockerfiles/server-mysql/alpine/Dockerfile | 65 ++++++----- Dockerfiles/server-mysql/centos/Dockerfile | 82 +++++++------- Dockerfiles/server-mysql/ol/Dockerfile | 88 ++++++++------- Dockerfiles/server-mysql/rhel/Dockerfile | 70 ++++++------ Dockerfiles/server-mysql/ubuntu/Dockerfile | 77 +++++++------ Dockerfiles/server-pgsql/alpine/Dockerfile | 85 +++++++------- Dockerfiles/server-pgsql/centos/Dockerfile | 83 +++++++------- Dockerfiles/server-pgsql/ol/Dockerfile | 72 ++++++------ Dockerfiles/server-pgsql/ubuntu/Dockerfile | 77 +++++++------ Dockerfiles/snmptraps/alpine/Dockerfile | 35 +++--- Dockerfiles/snmptraps/centos/Dockerfile | 44 ++++---- Dockerfiles/snmptraps/ol/Dockerfile | 47 ++++---- Dockerfiles/snmptraps/rhel/Dockerfile | 55 ++++----- Dockerfiles/snmptraps/ubuntu/Dockerfile | 39 ++++--- .../web-apache-mysql/alpine/Dockerfile | 70 +++++++----- .../web-apache-mysql/centos/Dockerfile | 83 +++++++------- Dockerfiles/web-apache-mysql/ol/Dockerfile | 86 ++++++++------- .../web-apache-mysql/ubuntu/Dockerfile | 72 ++++++------ .../web-apache-pgsql/alpine/Dockerfile | 70 +++++++----- .../web-apache-pgsql/centos/Dockerfile | 81 +++++++------- Dockerfiles/web-apache-pgsql/ol/Dockerfile | 84 +++++++------- .../web-apache-pgsql/ubuntu/Dockerfile | 74 +++++++------ Dockerfiles/web-nginx-mysql/alpine/Dockerfile | 65 ++++++----- Dockerfiles/web-nginx-mysql/centos/Dockerfile | 85 +++++++------- Dockerfiles/web-nginx-mysql/ol/Dockerfile | 88 ++++++++------- Dockerfiles/web-nginx-mysql/rhel/Dockerfile | 84 +++++++------- Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile | 104 ++++++++++-------- Dockerfiles/web-nginx-pgsql/alpine/Dockerfile | 65 ++++++----- Dockerfiles/web-nginx-pgsql/centos/Dockerfile | 99 +++++++++-------- Dockerfiles/web-nginx-pgsql/ol/Dockerfile | 96 ++++++++-------- Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile | 102 +++++++++-------- Dockerfiles/web-service/alpine/Dockerfile | 37 ++++--- Dockerfiles/web-service/alpine/hooks/build | 13 --- Dockerfiles/web-service/centos/Dockerfile | 58 +++++----- Dockerfiles/web-service/centos/hooks/build | 13 --- Dockerfiles/web-service/ol/Dockerfile | 55 +++++---- Dockerfiles/web-service/ol/hooks/build | 13 --- Dockerfiles/web-service/rhel/Dockerfile | 10 +- Dockerfiles/web-service/rhel/hooks/build | 13 --- Dockerfiles/web-service/ubuntu/Dockerfile | 69 +++++++----- Dockerfiles/web-service/ubuntu/hooks/build | 13 --- Dockerfiles/zabbix-appliance/rhel/Dockerfile | 6 +- build.sh | 21 +++- 103 files changed, 2522 insertions(+), 2305 deletions(-) delete mode 100755 Dockerfiles/agent/alpine/hooks/build delete mode 100755 Dockerfiles/agent/centos/hooks/build delete mode 100755 Dockerfiles/agent/ol/hooks/build delete mode 100755 Dockerfiles/agent/rhel/hooks/build delete mode 100755 Dockerfiles/agent/ubuntu/hooks/build delete mode 100755 Dockerfiles/agent2/alpine/hooks/build delete mode 100755 Dockerfiles/agent2/centos/hooks/build delete mode 100755 Dockerfiles/agent2/ol/hooks/build delete mode 100755 Dockerfiles/agent2/rhel/hooks/build delete mode 100755 Dockerfiles/agent2/ubuntu/hooks/build delete mode 100755 Dockerfiles/web-service/alpine/hooks/build delete mode 100755 Dockerfiles/web-service/centos/hooks/build delete mode 100755 Dockerfiles/web-service/ol/hooks/build delete mode 100755 Dockerfiles/web-service/rhel/hooks/build delete mode 100755 Dockerfiles/web-service/ubuntu/hooks/build diff --git a/Dockerfiles/agent/alpine/Dockerfile b/Dockerfiles/agent/alpine/Dockerfile index a9f0420ce..5628c50d8 100644 --- a/Dockerfiles/agent/alpine/Dockerfile +++ b/Dockerfiles/agent/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -32,8 +32,25 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc/zabbix/zabbix_agentd.conf"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="tini \ + bash \ + tzdata \ + coreutils \ + iputils \ + pcre \ + libcurl \ + libmodbus \ + libldap" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -47,16 +64,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ - apk add --no-cache --clean-protected \ - tini \ - bash \ - tzdata \ - coreutils \ - iputils \ - pcre \ - libcurl \ - libmodbus \ - libldap && \ 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/ && \ diff --git a/Dockerfiles/agent/alpine/hooks/build b/Dockerfiles/agent/alpine/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent/alpine/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent/centos/Dockerfile b/Dockerfiles/agent/centos/Dockerfile index 9f31686b0..a85eefd38 100644 --- a/Dockerfiles/agent/centos/Dockerfile +++ b/Dockerfiles/agent/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -32,7 +32,19 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc/zabbix/zabbix_agentd.conf"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + REPOLIST="baseos,appstream,epel" && \ + INSTALL_PKGS="bash \ + tini \ + tzdata \ + iputils \ + pcre \ + libcurl-minimal \ + openssl-libs \ + zlib" && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ --system --comment "Zabbix monitoring system" \ -g zabbix -G root \ @@ -45,27 +57,18 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ - REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="bash \ - tini \ - tzdata \ - iputils \ - pcre \ - libcurl-minimal \ - openssl-libs \ - zlib" && \ dnf -y install epel-release && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + dnf -y clean all && \ 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/ && \ - dnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/agent/centos/hooks/build b/Dockerfiles/agent/centos/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent/centos/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent/ol/Dockerfile b/Dockerfiles/agent/ol/Dockerfile index 832aeb85a..cd409c47e 100644 --- a/Dockerfiles/agent/ol/Dockerfile +++ b/Dockerfiles/agent/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -33,9 +33,30 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + tini \ + tzdata \ + iputils \ + pcre \ + libcurl \ + openssl-libs \ + zlib" && \ + microdnf -y install \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ + --system \ + --comment "Zabbix monitoring system" \ -g zabbix -G root \ --uid 1997 \ --shell /sbin/nologin \ @@ -46,22 +67,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ - INSTALL_PKGS="bash \ - tini \ - tzdata \ - iputils \ - pcre \ - libcurl \ - openssl-libs \ - zlib" && \ - microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ 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/ && \ diff --git a/Dockerfiles/agent/ol/hooks/build b/Dockerfiles/agent/ol/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent/ol/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent/rhel/Dockerfile b/Dockerfiles/agent/rhel/Dockerfile index cbc2f9eec..0f0e5f130 100644 --- a/Dockerfiles/agent/rhel/Dockerfile +++ b/Dockerfiles/agent/rhel/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -11,35 +11,36 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL name="zabbix/zabbix-agent-trunk" \ +LABEL description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-agent-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-agent --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-trunk:${ZBX_VERSION}" \ + summary="Zabbix agent" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix agent" \ - description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-agent --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ io.k8s.display-name="Zabbix Agent" \ io.openshift.expose-services="10050:10050" \ io.openshift.tags="zabbix,zabbix-agent" \ - org.label-schema.name="zabbix-agent-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \ + org.label-schema.docker.cmd="docker run --name zabbix-agent --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-agent-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-agent --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -49,7 +50,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get", "/u COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender", "/usr/bin/zabbix_sender"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc/zabbix/zabbix_agentd.conf"] -RUN set -eux && INSTALL_PKGS="bash \ +RUN set -eux && \ + INSTALL_PKGS="bash \ tini \ tzdata \ iputils \ @@ -60,16 +62,20 @@ RUN set -eux && INSTALL_PKGS="bash \ rpm -ivh /tmp/epel-release-latest-8.noarch.rpm && \ rm -rf /tmp/epel-release-latest-8.noarch.rpm && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "epel" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ + --system \ + --comment "Zabbix monitoring system" \ -g zabbix -G root \ --uid 1997 \ --shell /sbin/nologin \ @@ -80,10 +86,10 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ - microdnf -y clean all && \ 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/ && \ + microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/agent/rhel/hooks/build b/Dockerfiles/agent/rhel/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent/rhel/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent/ubuntu/Dockerfile b/Dockerfiles/agent/ubuntu/Dockerfile index fbe08cee5..5323fc4bc 100644 --- a/Dockerfiles/agent/ubuntu/Dockerfile +++ b/Dockerfiles/agent/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -33,10 +33,27 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_agentd.conf", "/etc RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + tini \ + tzdata \ + ca-certificates \ + libssl1.1 \ + libcurl4 \ + libmodbus5 \ + libldap-2.4" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -46,15 +63,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - tini \ - tzdata \ - ca-certificates \ - libssl1.1 \ - libcurl4 \ - libmodbus5 \ - libldap-2.4 && \ 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/ && \ diff --git a/Dockerfiles/agent/ubuntu/hooks/build b/Dockerfiles/agent/ubuntu/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent/ubuntu/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent/windows/Dockerfile b/Dockerfiles/agent/windows/Dockerfile index d664d8a49..13545a9d9 100644 --- a/Dockerfiles/agent/windows/Dockerfile +++ b/Dockerfiles/agent/windows/Dockerfile @@ -3,7 +3,7 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git + ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 FROM ${BUILD_BASE_IMAGE} as builder @@ -12,10 +12,6 @@ FROM $BASE_IMAGE ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES - -ARG MAJOR_VERSION=6.0 -ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git LABEL org.opencontainers.image.title="Zabbix agent" ` diff --git a/Dockerfiles/agent2/alpine/Dockerfile b/Dockerfiles/agent2/alpine/Dockerfile index d0539b55c..34015ac3b 100644 --- a/Dockerfiles/agent2/alpine/Dockerfile +++ b/Dockerfiles/agent2/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent 2" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent 2" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -32,8 +32,22 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_agent2.conf", "/etc/zabbix/zabbix_agent2.conf"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="tini \ + tzdata \ + bash \ + pcre \ + coreutils \ + iputils" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -48,13 +62,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ mkdir -p /var/lib/zabbix/buffer && \ - apk add --no-cache --clean-protected \ - tini \ - tzdata \ - bash \ - pcre \ - coreutils \ - iputils && \ 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/ && \ @@ -64,8 +71,6 @@ EXPOSE 10050/TCP 31999/TCP WORKDIR /var/lib/zabbix -VOLUME ["/var/lib/zabbix/enc"] - COPY ["docker-entrypoint.sh", "/usr/bin/"] ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"] diff --git a/Dockerfiles/agent2/alpine/hooks/build b/Dockerfiles/agent2/alpine/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent2/alpine/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent2/centos/Dockerfile b/Dockerfiles/agent2/centos/Dockerfile index 7861d9884..6d24da14f 100644 --- a/Dockerfiles/agent2/centos/Dockerfile +++ b/Dockerfiles/agent2/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent 2" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent 2" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -32,10 +32,23 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_agent2.conf", "/etc/zabbix/zabbix_agent2.conf"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + REPOLIST="baseos,appstream,epel" && \ + INSTALL_PKGS="bash \ + tini \ + tzdata \ + iputils \ + pcre \ + libcurl-minimal \ + openssl-libs" && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -46,14 +59,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ mkdir -p /var/lib/zabbix/buffer && \ - REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="bash \ - tini \ - tzdata \ - iputils \ - pcre \ - libcurl-minimal \ - openssl-libs" && \ dnf -y install epel-release && \ dnf -y install \ --disablerepo "*" \ @@ -62,10 +67,10 @@ RUN set -eux && \ --setopt=install_weak_deps=False \ --best \ ${INSTALL_PKGS} && \ + dnf -y clean all && \ 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/ && \ - dnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki @@ -73,8 +78,6 @@ EXPOSE 10050/TCP 31999/TCP WORKDIR /var/lib/zabbix -VOLUME ["/var/lib/zabbix/enc"] - COPY ["docker-entrypoint.sh", "/usr/bin/"] ENTRYPOINT ["/usr/bin/tini", "--", "/usr/bin/docker-entrypoint.sh"] diff --git a/Dockerfiles/agent2/centos/hooks/build b/Dockerfiles/agent2/centos/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent2/centos/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent2/ol/Dockerfile b/Dockerfiles/agent2/ol/Dockerfile index 077e377cc..e6531a0f0 100644 --- a/Dockerfiles/agent2/ol/Dockerfile +++ b/Dockerfiles/agent2/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent 2" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent 2" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -33,10 +33,22 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_agent2.conf" COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + tini \ + tzdata \ + iputils \ + pcre \ + libcurl \ + openssl-libs" && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -47,21 +59,16 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ mkdir -p /var/lib/zabbix/buffer && \ - INSTALL_PKGS="bash \ - tini \ - tzdata \ - iputils \ - pcre \ - libcurl \ - openssl-libs" && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + microdnf -y clean all && \ 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/ && \ @@ -73,8 +80,6 @@ EXPOSE 10050/TCP 31999/TCP WORKDIR /var/lib/zabbix -VOLUME ["/var/lib/zabbix/enc"] - COPY ["docker-entrypoint.sh", "/usr/bin/"] ENTRYPOINT ["/usr/bin/tini", "--", "/usr/bin/docker-entrypoint.sh"] diff --git a/Dockerfiles/agent2/ol/hooks/build b/Dockerfiles/agent2/ol/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent2/ol/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent2/rhel/Dockerfile b/Dockerfiles/agent2/rhel/Dockerfile index 2688b3ff4..acb3c505c 100644 --- a/Dockerfiles/agent2/rhel/Dockerfile +++ b/Dockerfiles/agent2/rhel/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -11,35 +11,36 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL name="zabbix/zabbix-agent2-trunk" \ +LABEL description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-agent2-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-trunk:${ZBX_VERSION}" \ + summary="Zabbix agent" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix agent" \ - description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ io.k8s.display-name="Zabbix Agent 2" \ io.openshift.expose-services="10050:10050" \ io.openshift.tags="zabbix,zabbix-agent" \ - org.label-schema.name="zabbix-agent2-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \ + org.label-schema.docker.cmd="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-agent2-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -49,7 +50,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get", "/u COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender", "/usr/bin/zabbix_sender"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_agent2.conf", "/etc/zabbix/zabbix_agent2.conf"] -RUN set -eux && INSTALL_PKGS="bash \ +RUN set -eux && \ + INSTALL_PKGS="bash \ tini \ tzdata \ iputils \ @@ -60,17 +62,22 @@ RUN set -eux && INSTALL_PKGS="bash \ rpm -ivh /tmp/epel-release-latest-8.noarch.rpm && \ rm -rf /tmp/epel-release-latest-8.noarch.rpm && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "epel" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -81,10 +88,10 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ mkdir -p /var/lib/zabbix/buffer && \ - microdnf -y clean all && \ 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/ && \ + microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki @@ -92,8 +99,6 @@ EXPOSE 10050/TCP 31999/TCP WORKDIR /var/lib/zabbix -VOLUME ["/var/lib/zabbix/enc"] - COPY ["docker-entrypoint.sh", "/usr/bin/"] ENTRYPOINT ["/usr/bin/tini", "--", "/usr/bin/docker-entrypoint.sh"] diff --git a/Dockerfiles/agent2/rhel/hooks/build b/Dockerfiles/agent2/rhel/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent2/rhel/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent2/ubuntu/Dockerfile b/Dockerfiles/agent2/ubuntu/Dockerfile index 1649bc772..afe3a9fba 100644 --- a/Dockerfiles/agent2/ubuntu/Dockerfile +++ b/Dockerfiles/agent2/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix agent 2" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +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" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix agent 2" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -33,10 +33,25 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_agent2.conf" RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="tini \ + tzdata \ + ca-certificates \ + libssl1.1 \ + libcurl4 \ + libldap-2.4" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -47,14 +62,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix/enc && \ mkdir -p /var/lib/zabbix/modules && \ mkdir -p /var/lib/zabbix/buffer && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - tini \ - tzdata \ - ca-certificates \ - libssl1.1 \ - libcurl4 \ - libldap-2.4 && \ 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/ && \ diff --git a/Dockerfiles/agent2/ubuntu/hooks/build b/Dockerfiles/agent2/ubuntu/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/agent2/ubuntu/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/agent2/windows/Dockerfile b/Dockerfiles/agent2/windows/Dockerfile index 065d8d39b..9f03088ac 100644 --- a/Dockerfiles/agent2/windows/Dockerfile +++ b/Dockerfiles/agent2/windows/Dockerfile @@ -3,7 +3,7 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent2-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git + ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 FROM ${BUILD_BASE_IMAGE} as builder @@ -12,10 +12,6 @@ FROM $BASE_IMAGE ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES - -ARG MAJOR_VERSION=6.0 -ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git LABEL org.opencontainers.image.title="Zabbix agent 2" ` diff --git a/Dockerfiles/build-base/alpine/Dockerfile b/Dockerfiles/build-base/alpine/Dockerfile index cabaa6182..ee8388394 100644 --- a/Dockerfiles/build-base/alpine/Dockerfile +++ b/Dockerfiles/build-base/alpine/Dockerfile @@ -3,25 +3,23 @@ FROM alpine:3.14 ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} \ PATH=/usr/lib/jvm/default-jvm/bin:$PATH \ JAVA_HOME=/usr/lib/jvm/default-jvm -LABEL org.opencontainers.image.title="Zabbix build base" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="Zabbix build base" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ - apk add --no-cache --clean-protected \ - bash \ + INSTALL_PKGS="bash \ autoconf \ automake \ coreutils \ @@ -45,5 +43,9 @@ RUN set -eux && \ go \ make \ openjdk8-jre-base \ - unixodbc-dev && \ + unixodbc-dev" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ rm -rf /var/cache/apk/* diff --git a/Dockerfiles/build-base/centos/Dockerfile b/Dockerfiles/build-base/centos/Dockerfile index 4a3db47e8..2855e1a90 100644 --- a/Dockerfiles/build-base/centos/Dockerfile +++ b/Dockerfiles/build-base/centos/Dockerfile @@ -1,28 +1,24 @@ # syntax=docker/dockerfile:1 -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} \ PATH=/usr/local/go/bin:$PATH -LABEL org.opencontainers.image.title="Zabbix build base" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="Zabbix build base" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ - sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Linux-PowerTools.repo && \ - dnf --quiet makecache && \ - dnf -y install epel-release && \ - dnf -y module enable mysql && \ + REPOLIST="baseos,appstream,powertools" && \ INSTALL_PKGS="autoconf \ automake \ bash \ @@ -47,8 +43,15 @@ RUN set -eux && \ tar \ gettext \ unixODBC-devel" && \ - dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \ + dnf -y module enable mysql && \ + dnf -y install \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + dnf -y clean all && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ x86_64) \ @@ -75,6 +78,5 @@ RUN set -eux && \ rm -rf "$GNUPGHOME" go.tgz.asc && \ tar -C /usr/local -xzf go.tgz && \ rm go.tgz && \ - dnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/build-base/ol/Dockerfile b/Dockerfiles/build-base/ol/Dockerfile index 8114050e9..3bcded421 100644 --- a/Dockerfiles/build-base/ol/Dockerfile +++ b/Dockerfiles/build-base/ol/Dockerfile @@ -3,23 +3,21 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} \ PATH=/usr/local/go/bin:$PATH -LABEL org.opencontainers.image.title="Zabbix build base" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="Zabbix build base" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ - microdnf -y module enable mysql && \ INSTALL_PKGS="autoconf \ automake \ bash \ @@ -44,6 +42,7 @@ RUN set -eux && \ tar \ gettext \ unixODBC-devel" && \ + microdnf -y module enable mysql && \ microdnf -y install \ --disablerepo "*" \ --enablerepo "ol8_baseos_latest" \ @@ -52,6 +51,7 @@ RUN set -eux && \ --setopt=install_weak_deps=0 \ --best \ --nodocs ${INSTALL_PKGS} && \ + microdnf -y clean all && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ x86_64) \ @@ -74,6 +74,5 @@ RUN set -eux && \ rm -rf "$GNUPGHOME" go.tgz.asc && \ tar -C /usr/local -xzf go.tgz && \ rm go.tgz && \ - microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/build-base/rhel/Dockerfile b/Dockerfiles/build-base/rhel/Dockerfile index 64cd6dae1..a6458c1d2 100644 --- a/Dockerfiles/build-base/rhel/Dockerfile +++ b/Dockerfiles/build-base/rhel/Dockerfile @@ -4,33 +4,32 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION=6.0 ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} \ PATH=/usr/local/go/bin:$PATH -LABEL name="zabbix/zabbix-build-base-trunk" \ +LABEL description="Prepared environment to build Zabbix components" \ maintainer="alexey.pustovalov@zabbix.com" \ - vendor="Zabbix LLC" \ - version="${MAJOR_VERSION}" \ + name="zabbix/zabbix-build-base-trunk" \ release="${RELEASE}" \ summary="Zabbix build base" \ - description="Prepared environment to build Zabbix components" \ url="https://www.zabbix.com/" \ + vendor="Zabbix LLC" \ + version="${MAJOR_VERSION}" \ io.k8s.description="Prepared environment to build Zabbix components" \ io.k8s.display-name="Zabbix build base" \ io.openshift.expose-services="" \ io.openshift.tags="zabbix,build" \ - org.label-schema.name="zabbix-build-base-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ org.label-schema.description="Prepared environment to build Zabbix components" \ - org.label-schema.vcs-ref="${VCS_REF}" + org.label-schema.name="zabbix-build-base-rhel" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.vcs-ref="${VCS_REF}" \ + org.label-schema.vendor="Zabbix LLC" COPY ["licenses", "/licenses"] RUN set -eux && \ - microdnf -y module enable mysql && \ INSTALL_PKGS="autoconf \ automake \ bash \ @@ -55,22 +54,19 @@ RUN set -eux && \ tar \ gettext \ unixODBC-devel" && \ - curl -sSL -o /tmp/epel-release-latest-8.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \ - rpm -ivh /tmp/epel-release-latest-8.noarch.rpm && \ - rm -rf /tmp/epel-release-latest-8.noarch.rpm && \ microdnf -y module enable mysql && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "ubi-8-appstream" \ - --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ - --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ - --enablerepo "codeready-builder-for-rhel-8-x86_64-rpms" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "ubi-8-appstream" \ + --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ + --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ + --enablerepo "codeready-builder-for-rhel-8-x86_64-rpms" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ + microdnf -y clean all && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ x86_64) \ @@ -81,6 +77,10 @@ RUN set -eux && \ url='https://dl.google.com/go/go1.17.2.linux-arm64.tar.gz'; \ sha256='a5a43c9cdabdb9f371d56951b14290eba8ce2f9b0db48fb5fc657943984fd4fc'; \ ;; \ + ppc64le) \ + url='https://golang.org/dl/go1.17.2.linux-ppc64le.tar.gz'; \ + sha256='12e2dc7e0ffeebe77083f267ef6705fec1621cdf2ed6489b3af04a13597ed68d'; \ + ;; \ *) echo "Unknown ARCH_SUFFIX=${ARCH_SUFFIX-}"; exit 1 ;; \ esac; \ wget -O go.tgz.asc "$url.asc" && \ @@ -93,6 +93,5 @@ RUN set -eux && \ rm -rf "$GNUPGHOME" go.tgz.asc && \ tar -C /usr/local -xzf go.tgz && \ rm go.tgz && \ - microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/build-base/ubuntu/Dockerfile b/Dockerfiles/build-base/ubuntu/Dockerfile index 11a4cf806..5d4156910 100644 --- a/Dockerfiles/build-base/ubuntu/Dockerfile +++ b/Dockerfiles/build-base/ubuntu/Dockerfile @@ -3,25 +3,22 @@ FROM ubuntu:focal ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} \ PATH=/usr/lib/go-1.16/bin:$PATH -LABEL org.opencontainers.image.title="Zabbix build base" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="Zabbix build base" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - bash \ + INSTALL_PKGS="bash \ autoconf \ automake \ binutils \ @@ -45,7 +42,11 @@ RUN set -eux && \ gettext \ git \ golang-1.16 \ - unixodbc-dev && \ + unixodbc-dev" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfiles/build-base/windows/Dockerfile.agent b/Dockerfiles/build-base/windows/Dockerfile.agent index c102b0c24..71d255339 100644 --- a/Dockerfiles/build-base/windows/Dockerfile.agent +++ b/Dockerfiles/build-base/windows/Dockerfile.agent @@ -11,7 +11,6 @@ ARG CPU_MODEL=AMD64 ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/16/release/vs_buildtools.exe ARG NASM_URL=https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-installer-x64.exe @@ -21,7 +20,8 @@ ARG PCRE_URL=https://ftp.pcre.org/pub/pcre/pcre-$PCRE_VERSION.zip ARG OPENSSL_URL=https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz ARG LIBMODBUS_URL=https://github.com/stephane/libmodbus.git -ENV BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL ` +ENV ZBX_VERSION=$ZBX_VERSION ` + BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL ` PCRE_VERSION=$PCRE_VERSION OPENSSL_VERSION=$OPENSSL_VERSION LIBMODBUS_VERSION=$LIBMODBUS_VERSION ` GIT_URL=$GIT_URL NASM_URL=$NASM_URL PERL_URL=$PERL_URL LIBMODBUS_URL=$LIBMODBUS_URL PCRE_URL=$PCRE_URL OPENSSL_URL=$OPENSSL_URL @@ -32,8 +32,7 @@ LABEL org.opencontainers.image.title="Zabbix agent build base for Windows" ` org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent images" ` org.opencontainers.image.licenses="GPL v2.0" ` org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" ` - org.opencontainers.image.version="${ZBX_VERSION}" ` - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.version="${ZBX_VERSION}" SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/Dockerfiles/build-base/windows/Dockerfile.agent2 b/Dockerfiles/build-base/windows/Dockerfile.agent2 index 4d9b20165..1d2cbb0ef 100644 --- a/Dockerfiles/build-base/windows/Dockerfile.agent2 +++ b/Dockerfiles/build-base/windows/Dockerfile.agent2 @@ -13,7 +13,6 @@ ARG CPU_MODEL=AMD64 ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/16/release/vs_buildtools.exe ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip @@ -24,7 +23,8 @@ ARG PCRE_URL=https://ftp.pcre.org/pub/pcre/pcre-$PCRE_VERSION.zip ARG OPENSSL_URL=https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz ARG SEVEN_ZIP_URL=https://www.7-zip.org/a/7z$SEVEN_ZIP_VERSION-$BUILD_ARCH.msi -ENV BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL ` +ENV ZBX_VERSION=$ZBX_VERSION ` + BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL ` PCRE_VERSION=$PCRE_VERSION OPENSSL_VERSION=$OPENSSL_VERSION ZLIB_VERSION=$ZLIB_VERSION ` GOLANG_VERSION=$GOLANG_VERSION SEVEN_ZIP_VERSION=$SEVEN_ZIP_VERSION ` GIT_URL=$GIT_URL MINGW_URL=$MINGW_URL CYGWIN_URL=$CYGWIN_URL GOLANG_URL=$GOLANG_URL SEVEN_ZIP_URL=$SEVEN_ZIP_URL ` @@ -37,8 +37,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" ` org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent 2 images" ` org.opencontainers.image.licenses="GPL v2.0" ` org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" ` - org.opencontainers.image.version="${ZBX_VERSION}" ` - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.version="${ZBX_VERSION}" SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/Dockerfiles/build-mysql/alpine/Dockerfile b/Dockerfiles/build-mysql/alpine/Dockerfile index d84977afe..5612bebd6 100644 --- a/Dockerfiles/build-mysql/alpine/Dockerfile +++ b/Dockerfiles/build-mysql/alpine/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for MySQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,21 +36,21 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-mysql \ --with-ldap \ --with-libcurl \ + --with-libmodbus \ --with-libxml2 \ - --enable-java \ + --with-mysql \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --with-ssh \ - --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-mysql/centos/Dockerfile b/Dockerfiles/build-mysql/centos/Dockerfile index 2ce944340..a58be2038 100644 --- a/Dockerfiles/build-mysql/centos/Dockerfile +++ b/Dockerfiles/build-mysql/centos/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for MySQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -34,22 +34,23 @@ RUN set -eux && \ --libdir=/usr/lib/zabbix \ --prefix=/usr \ --sysconfdir=/etc/zabbix \ + --enable-ipv6 \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-mysql \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ + --with-mysql \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --with-ssh \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-mysql/ol/Dockerfile b/Dockerfiles/build-mysql/ol/Dockerfile index a46689f60..d214b3a47 100644 --- a/Dockerfiles/build-mysql/ol/Dockerfile +++ b/Dockerfiles/build-mysql/ol/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for MySQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -34,22 +34,23 @@ RUN set -eux && \ --libdir=/usr/lib/zabbix \ --prefix=/usr \ --sysconfdir=/etc/zabbix \ + --enable-ipv6 \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-mysql \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ + --with-mysql \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --with-ssh \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-mysql/rhel/Dockerfile b/Dockerfiles/build-mysql/rhel/Dockerfile index 0d68d0a2f..ad41f74ae 100644 --- a/Dockerfiles/build-mysql/rhel/Dockerfile +++ b/Dockerfiles/build-mysql/rhel/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-base:rhel-${ZBX_VERSION} @@ -10,23 +11,23 @@ ARG RELEASE ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL name="zabbix/zabbix-build-mysql-trunk" \ +LABEL description="Zabbix build base for MySQL based images" \ maintainer="alexey.pustovalov@zabbix.com" \ - vendor="Zabbix LLC" \ - version="${MAJOR_VERSION}" \ + name="zabbix/zabbix-build-mysql-trunk" \ release="${RELEASE}" \ summary="Zabbix build base (MySQL)" \ - description="Zabbix build base for MySQL based images" \ url="https://www.zabbix.com/" \ + vendor="Zabbix LLC" \ + version="${MAJOR_VERSION}" \ io.k8s.description="Zabbix build base for MySQL based images" \ io.k8s.display-name="Zabbix build base (MySQL)" \ io.openshift.expose-services="" \ io.openshift.tags="zabbix,build,mysql" \ - org.label-schema.name="zabbix-build-mysql-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ org.label-schema.description="Zabbix build base for MySQL based images" \ - org.label-schema.vcs-ref="${VCS_REF}" + org.label-schema.name="zabbix-build-mysql-rhel" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.vcs-ref="${VCS_REF}" \ + org.label-schema.vendor="Zabbix LLC" RUN set -eux && \ cd /tmp/ && \ @@ -43,22 +44,23 @@ RUN set -eux && \ --libdir=/usr/lib/zabbix \ --prefix=/usr \ --sysconfdir=/etc/zabbix \ + --enable-ipv6 \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-mysql \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ + --with-mysql \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --with-ssh \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ @@ -78,3 +80,5 @@ RUN set -eux && \ strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get && \ strip /tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender && \ strip /tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_web_service + + diff --git a/Dockerfiles/build-mysql/ubuntu/Dockerfile b/Dockerfiles/build-mysql/ubuntu/Dockerfile index a4a9a4686..08a631a53 100644 --- a/Dockerfiles/build-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/build-mysql/ubuntu/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for MySQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -34,23 +34,23 @@ RUN set -eux && \ --libdir=/usr/lib/zabbix \ --prefix=/usr \ --sysconfdir=/etc/zabbix \ + --enable-ipv6 \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-mysql \ --with-ldap \ --with-libcurl \ + --with-libmodbus \ --with-libxml2 \ - --enable-java \ + --with-mysql \ --with-net-snmp \ --with-openipmi \ --with-openssl \ --with-ssh \ - --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-mysql/windows/Dockerfile.agent b/Dockerfiles/build-mysql/windows/Dockerfile.agent index f33915346..9ba206844 100644 --- a/Dockerfiles/build-mysql/windows/Dockerfile.agent +++ b/Dockerfiles/build-mysql/windows/Dockerfile.agent @@ -10,7 +10,6 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG ZABBIX_VERSION_RC_NUM=2400 -ARG ZBX_COMPONENT=all ENV ZBX_SOURCES=$ZBX_SOURCES MAJOR_VERSION=$MAJOR_VERSION ZBX_VERSION=$ZBX_VERSION ZABBIX_VERSION_RC_NUM=$ZABBIX_VERSION_RC_NUM LABEL org.opencontainers.image.title="Zabbix agent build (Windows)" ` @@ -50,7 +49,7 @@ RUN Set-Location -Path $env:SystemDrive\.; ` TLSLIBDIR=$env:SystemDrive\openssl_output\lib ` MODBINCDIR=$env:SystemDrive\libmodbus\src ` MODBLIBDIR=$env:SystemDrive\libmodbus\src\win32\$env:BUILD_ARCH\Release ` - $env:ZBX_COMPONENT; ` + all; ` ` Write-Host 'Verifying build ("zabbix_agentd.exe -V") ...'; ` & $env:SystemDrive\zabbix-$env:ZBX_VERSION\bin\win64\zabbix_agentd.exe -V; ` diff --git a/Dockerfiles/build-mysql/windows/Dockerfile.agent2 b/Dockerfiles/build-mysql/windows/Dockerfile.agent2 index 3585c431c..51f820a39 100644 --- a/Dockerfiles/build-mysql/windows/Dockerfile.agent2 +++ b/Dockerfiles/build-mysql/windows/Dockerfile.agent2 @@ -12,7 +12,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION}.0 ARG ZABBIX_VERSION_RC_NUM=2400 ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ARG ZBX_COMPONENT=all ENV ZBX_SOURCES=$ZBX_SOURCES MAJOR_VERSION=$MAJOR_VERSION ZBX_VERSION=$ZBX_VERSION LABEL org.opencontainers.image.title="Zabbix agent 2 build (Windows)" ` diff --git a/Dockerfiles/build-pgsql/alpine/Dockerfile b/Dockerfiles/build-pgsql/alpine/Dockerfile index 55f3e06e7..439389f11 100644 --- a/Dockerfiles/build-pgsql/alpine/Dockerfile +++ b/Dockerfiles/build-pgsql/alpine/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,21 +36,21 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-postgresql \ --with-ldap \ --with-libcurl \ + --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-postgresql \ --with-ssh \ - --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-pgsql/centos/Dockerfile b/Dockerfiles/build-pgsql/centos/Dockerfile index 519aa99c1..65fcfdb48 100644 --- a/Dockerfiles/build-pgsql/centos/Dockerfile +++ b/Dockerfiles/build-pgsql/centos/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,21 +36,21 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-postgresql \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-postgresql \ --with-ssh \ -# --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-pgsql/ol/Dockerfile b/Dockerfiles/build-pgsql/ol/Dockerfile index 038e52a01..8b523a78d 100644 --- a/Dockerfiles/build-pgsql/ol/Dockerfile +++ b/Dockerfiles/build-pgsql/ol/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,21 +36,21 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-postgresql \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-postgresql \ --with-ssh \ -# --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-pgsql/ubuntu/Dockerfile b/Dockerfiles/build-pgsql/ubuntu/Dockerfile index ca6c2b0ad..dbb816991 100644 --- a/Dockerfiles/build-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/build-pgsql/ubuntu/Dockerfile @@ -9,15 +9,15 @@ ARG MAJOR_VERSION ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,21 +36,21 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ - --enable-server \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ + --enable-server \ --enable-webservice \ - --with-postgresql \ --with-ldap \ --with-libcurl \ + --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-postgresql \ --with-ssh \ - --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-sqlite3/alpine/Dockerfile b/Dockerfiles/build-sqlite3/alpine/Dockerfile index 4fb1b0a9b..ace05e0bb 100644 --- a/Dockerfiles/build-sqlite3/alpine/Dockerfile +++ b/Dockerfiles/build-sqlite3/alpine/Dockerfile @@ -7,17 +7,17 @@ FROM ${BUILD_BASE_IMAGE} as builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,19 +36,19 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ - --with-sqlite3 \ --with-ldap \ --with-libcurl \ + --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-sqlite3 \ --with-ssh \ - --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-sqlite3/centos/Dockerfile b/Dockerfiles/build-sqlite3/centos/Dockerfile index a8e1d8586..7b536f4a8 100644 --- a/Dockerfiles/build-sqlite3/centos/Dockerfile +++ b/Dockerfiles/build-sqlite3/centos/Dockerfile @@ -7,17 +7,17 @@ FROM ${BUILD_BASE_IMAGE} as builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,18 +36,19 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ - --with-sqlite3 \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-sqlite3 \ --with-ssh \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-sqlite3/ol/Dockerfile b/Dockerfiles/build-sqlite3/ol/Dockerfile index 43b63521b..777d7ea6c 100644 --- a/Dockerfiles/build-sqlite3/ol/Dockerfile +++ b/Dockerfiles/build-sqlite3/ol/Dockerfile @@ -7,17 +7,17 @@ FROM ${BUILD_BASE_IMAGE} as builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix build base (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix build base (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ cd /tmp/ && \ @@ -36,18 +36,19 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ - --with-sqlite3 \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-sqlite3 \ --with-ssh \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-sqlite3/rhel/Dockerfile b/Dockerfiles/build-sqlite3/rhel/Dockerfile index bdf03fcca..6e19eb131 100644 --- a/Dockerfiles/build-sqlite3/rhel/Dockerfile +++ b/Dockerfiles/build-sqlite3/rhel/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-base:rhel-${ZBX_VERSION} @@ -10,23 +11,23 @@ ARG RELEASE ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL name="zabbix/zabbix-build-sqlite3-trunk" \ +LABEL description="Zabbix build base for SQLite3 based images" \ maintainer="alexey.pustovalov@zabbix.com" \ - vendor="Zabbix LLC" \ - version="${MAJOR_VERSION}" \ + name="zabbix/zabbix-build-sqlite3-trunk" \ release="${RELEASE}" \ summary="Zabbix build base (SQLite3)" \ - description="Zabbix build base for SQLite3 based images" \ url="https://www.zabbix.com/" \ + vendor="Zabbix LLC" \ + version="${MAJOR_VERSION}" \ io.k8s.description="Zabbix build base for SQLite3 based images" \ io.k8s.display-name="Zabbix build base (SQLite3)" \ io.openshift.expose-services="" \ io.openshift.tags="zabbix,build,sqlite3" \ - org.label-schema.name="zabbix-build-sqlite3-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ org.label-schema.description="Zabbix build base for SQLite3 based images" \ - org.label-schema.vcs-ref="${VCS_REF}" + org.label-schema.name="zabbix-build-sqlite3-rhel" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.vcs-ref="${VCS_REF}" \ + org.label-schema.vendor="Zabbix LLC" RUN set -eux && \ cd /tmp/ && \ @@ -45,18 +46,19 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ - --with-sqlite3 \ --with-ldap \ --with-libcurl \ +# --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-sqlite3 \ --with-ssh \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile index 93010ce7f..da9901c07 100644 --- a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile +++ b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile @@ -7,21 +7,21 @@ FROM ${BUILD_BASE_IMAGE} as builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ + org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \ + org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.source="${ZBX_SOURCES}" \ org.opencontainers.image.title="Zabbix build base (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.url="https://zabbix.com/" \ - org.opencontainers.image.description="Zabbix build base for SQLite3 based images" \ - org.opencontainers.image.licenses="GPL v2.0" + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" RUN set -eux && \ + cd /tmp/ && \ git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch master --depth 1 --single-branch /tmp/zabbix-${ZBX_VERSION} && \ - ls -lah /tmp/ && \ cd /tmp/zabbix-${ZBX_VERSION} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ @@ -36,19 +36,19 @@ RUN set -eux && \ --sysconfdir=/etc/zabbix \ --enable-agent \ --enable-agent2 \ + --enable-ipv6 \ + --enable-java \ --enable-proxy \ - --with-sqlite3 \ --with-ldap \ --with-libcurl \ + --with-libmodbus \ --with-libxml2 \ - --enable-java \ --with-net-snmp \ --with-openipmi \ --with-openssl \ + --with-sqlite3 \ --with-ssh \ - --with-libmodbus \ --with-unixodbc \ - --enable-ipv6 \ --silent && \ make -j"$(nproc)" -s dbschema && \ make -j"$(nproc)" -s && \ diff --git a/Dockerfiles/java-gateway/alpine/Dockerfile b/Dockerfiles/java-gateway/alpine/Dockerfile index 63e07542c..db20b02c1 100644 --- a/Dockerfiles/java-gateway/alpine/Dockerfile +++ b/Dockerfiles/java-gateway/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,20 +9,21 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +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 -LABEL org.opencontainers.image.title="Zabbix Java Gateway" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix Java Gateway" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,8 +31,18 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/bin", "/usr/sbi COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib", "/usr/sbin/zabbix_java/lib"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="bash \ + openjdk8-jre-base" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -44,9 +54,6 @@ RUN set -eux && \ mkdir -p /etc/zabbix/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ - apk add --clean-protected --no-cache \ - bash \ - openjdk8-jre-base && \ 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/ && \ diff --git a/Dockerfiles/java-gateway/centos/Dockerfile b/Dockerfiles/java-gateway/centos/Dockerfile index 9d4e01cca..6b6adf09e 100644 --- a/Dockerfiles/java-gateway/centos/Dockerfile +++ b/Dockerfiles/java-gateway/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix Java Gateway" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix Java Gateway" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,19 +30,9 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/bin", "/usr/sbi COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib", "/usr/sbin/zabbix_java/lib"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix/ && \ - mkdir -p /usr/sbin/zabbix_java/ && \ - mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ REPOLIST="baseos,appstream" && \ - INSTALL_PKGS="java-1.8.0-openjdk-headless \ + INSTALL_PKGS="bash \ + java-1.8.0-openjdk-headless \ findutils" && \ dnf -y install \ --disablerepo "*" \ @@ -51,6 +41,22 @@ RUN set -eux && \ --setopt=install_weak_deps=False \ --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix/ && \ + 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/ && \ diff --git a/Dockerfiles/java-gateway/ol/Dockerfile b/Dockerfiles/java-gateway/ol/Dockerfile index 336ace74c..9bdadc5f2 100644 --- a/Dockerfiles/java-gateway/ol/Dockerfile +++ b/Dockerfiles/java-gateway/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix Java Gateway" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix Java Gateway" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,10 +30,26 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/bin", "/usr/sbi COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib", "/usr/sbin/zabbix_java/lib"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + java-1.8.0-openjdk-headless \ + findutils" && \ + microdnf -y install \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -41,15 +57,6 @@ RUN set -eux && \ mkdir -p /etc/zabbix/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ - INSTALL_PKGS="java-1.8.0-openjdk-headless \ - findutils" && \ - microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ 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/ && \ diff --git a/Dockerfiles/java-gateway/rhel/Dockerfile b/Dockerfiles/java-gateway/rhel/Dockerfile index 059f92782..8fbacda8b 100644 --- a/Dockerfiles/java-gateway/rhel/Dockerfile +++ b/Dockerfiles/java-gateway/rhel/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -11,36 +11,37 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL name="zabbix/zabbix-java-gateway-trunk" \ +LABEL description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-java-gateway-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-java-gateway -p 10052:10052 -d registry.connect.redhat.com/zabbix/zabbix-java-gateway-trunk:${ZBX_VERSION}" \ + summary="Zabbix Java Gateway" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix Java Gateway" \ - description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-java-gateway -p 10052:10052 -d registry.connect.redhat.com/zabbix/zabbix-java-gateway-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ io.k8s.display-name="Zabbix Java Gateway" \ io.openshift.expose-services="10052:10052" \ io.openshift.tags="gateway,zabbix-java,java" \ - org.label-schema.name="zabbix-java-gateway-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ + org.label-schema.docker.cmd="docker run --name zabbix-java-gateway -p 10052:10052 -d registry.connect.redhat.com/zabbix/zabbix-java-gateway-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-java-gateway-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-java-gateway -p 10052:10052 -d registry.connect.redhat.com/zabbix/zabbix-java-gateway-trunk:${ZBX_VERSION}" - + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" + STOPSIGNAL SIGTERM COPY ["licenses", "/licenses"] @@ -60,10 +61,15 @@ RUN set -eux && \ --best \ --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -73,10 +79,10 @@ RUN set -eux && \ 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 && \ - microdnf -y clean all && \ 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/ && \ + microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/java-gateway/ubuntu/Dockerfile b/Dockerfiles/java-gateway/ubuntu/Dockerfile index 461941b3f..5f954c8ca 100644 --- a/Dockerfiles/java-gateway/ubuntu/Dockerfile +++ b/Dockerfiles/java-gateway/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix Java Gateway" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix Java Gateway" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,10 +31,21 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib", "/usr/sbi RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + openjdk-8-jre-headless && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -42,16 +53,13 @@ RUN set -eux && \ mkdir -p /etc/zabbix/ && \ mkdir -p /usr/sbin/zabbix_java/ && \ mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - openjdk-8-jre-headless && \ 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 && \ - apt-get -y autoremove && \ - apt-get -y clean && \ 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/ && \ + apt-get -y autoremove && \ + apt-get -y clean && \ rm -rf /var/lib/apt/lists/* EXPOSE 10052/TCP diff --git a/Dockerfiles/proxy-mysql/alpine/Dockerfile b/Dockerfiles/proxy-mysql/alpine/Dockerfile index d3c635ac1..c52232049 100644 --- a/Dockerfiles/proxy-mysql/alpine/Dockerfile +++ b/Dockerfiles/proxy-mysql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,20 +9,21 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -34,32 +34,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_proxy.sql.gz", "/usr/share/doc/zabbix-proxy-mysql/create.sql.gz"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ - --gecos "Zabbix monitoring system" \ - --disabled-password \ - --uid 1997 \ - --ingroup zabbix \ - --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ - zabbix && \ - adduser zabbix root && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ - apk add --clean-protected --no-cache \ + INSTALL_PKGS="bash \ tini \ - bash \ iputils \ libcurl \ libevent \ @@ -72,7 +48,38 @@ RUN set -eux && \ openipmi-libs \ pcre \ unixodbc \ - fping && \ + fping" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ + --gecos "Zabbix monitoring system" \ + --disabled-password \ + --uid 1997 \ + --ingroup zabbix \ + --shell /sbin/nologin \ + --home /var/lib/zabbix/ \ + zabbix && \ + adduser zabbix root && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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/ && \ diff --git a/Dockerfiles/proxy-mysql/centos/Dockerfile b/Dockerfiles/proxy-mysql/centos/Dockerfile index 9e2a06be4..d7b4a7e09 100644 --- a/Dockerfiles/proxy-mysql/centos/Dockerfile +++ b/Dockerfiles/proxy-mysql/centos/Dockerfile @@ -2,29 +2,28 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -35,28 +34,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_proxy.sql.gz", "/usr/share/doc/zabbix-proxy-mysql/create.sql.gz"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ - dnf -y module enable mysql && \ REPOLIST="baseos,appstream,epel" && \ INSTALL_PKGS="libevent \ tini \ @@ -74,14 +51,41 @@ RUN set -eux && \ pcre \ zlib \ unixODBC" && \ + dnf -y module enable mysql && \ dnf -y install epel-release && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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/ && \ diff --git a/Dockerfiles/proxy-mysql/ol/Dockerfile b/Dockerfiles/proxy-mysql/ol/Dockerfile index 09654a9cc..ccf078702 100644 --- a/Dockerfiles/proxy-mysql/ol/Dockerfile +++ b/Dockerfiles/proxy-mysql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,21 +9,21 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -36,10 +35,41 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_proxy.sql COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="libevent \ + tini \ + gzip \ + libssh \ + file-libs \ + fping \ + libxml2 \ + mysql \ + mysql-libs \ + net-snmp-libs \ + OpenIPMI-libs \ + openldap \ + openssl-libs \ + pcre \ + zlib \ + unixODBC" && \ + microdnf -y module enable mysql && \ + microdnf -y install \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -57,31 +87,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ - microdnf -y module enable mysql && \ - INSTALL_PKGS="libevent \ - tini \ - gzip \ - libssh \ - file-libs \ - fping \ - libxml2 \ - mysql \ - mysql-libs \ - net-snmp-libs \ - OpenIPMI-libs \ - openldap \ - openssl-libs \ - pcre \ - zlib \ - unixODBC" && \ - microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ 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/ && \ diff --git a/Dockerfiles/proxy-mysql/rhel/Dockerfile b/Dockerfiles/proxy-mysql/rhel/Dockerfile index 33650cbfc..7e7391a03 100644 --- a/Dockerfiles/proxy-mysql/rhel/Dockerfile +++ b/Dockerfiles/proxy-mysql/rhel/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git @@ -11,36 +12,37 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL name="zabbix/zabbix-proxy-mysql-trunk" \ +LABEL description="Zabbix proxy with MySQL database support" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-proxy-mysql-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-proxy --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-mysql-trunk:${ZBX_VERSION}" \ + summary="Zabbix proxy (MySQL)" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix proxy (MySQL)" \ - description="Zabbix proxy with MySQL database support" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-proxy --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-mysql-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix proxy with MySQL database support" \ io.k8s.display-name="Zabbix proxy (MySQL)" \ io.openshift.expose-services="10051:10051" \ io.openshift.tags="zabbix,zabbix-proxy,mysql" \ - org.label-schema.name="zabbix-proxy-mysql-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix proxy with MySQL database support" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix proxy with MySQL database support" \ + org.label-schema.docker.cmd="docker run --name zabbix-proxy --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-mysql-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-proxy-mysql-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-proxy --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-mysql-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -51,7 +53,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/zabbix/zabbix_proxy.conf"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_proxy.sql.gz", "/usr/share/doc/zabbix-proxy-mysql/create.sql.gz"] -RUN set -eux && INSTALL_PKGS="bash \ +RUN set -eux && \ + INSTALL_PKGS="bash \ tini \ shadow-utils \ fping \ @@ -72,20 +75,25 @@ RUN set -eux && INSTALL_PKGS="bash \ rm -rf /tmp/epel-release-latest-8.noarch.rpm && \ microdnf -y module enable mysql && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "ubi-8-appstream" \ - --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ - --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "ubi-8-appstream" \ + --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ + --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ + --enablerepo "epel" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -103,10 +111,10 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix/ssl/keys && \ mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ - microdnf -y clean all && \ 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/ && \ + microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/proxy-mysql/ubuntu/Dockerfile b/Dockerfiles/proxy-mysql/ubuntu/Dockerfile index 71e16b800..4bf9adbaf 100644 --- a/Dockerfiles/proxy-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/proxy-mysql/ubuntu/Dockerfile @@ -10,21 +10,21 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/var/lib/snmp/mibs/ietf:/var/lib/snmp/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -36,30 +36,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_proxy.sql RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - tini \ + INSTALL_PKGS="tini \ ca-certificates \ fping \ libcurl4 \ @@ -73,7 +50,37 @@ RUN set -eux && \ libxml2 \ mysql-client \ snmp-mibs-downloader \ - unixodbc && \ + unixodbc" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ 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/ && \ diff --git a/Dockerfiles/proxy-sqlite3/alpine/Dockerfile b/Dockerfiles/proxy-sqlite3/alpine/Dockerfile index a235d3d6b..4e53850b3 100644 --- a/Dockerfiles/proxy-sqlite3/alpine/Dockerfile +++ b/Dockerfiles/proxy-sqlite3/alpine/Dockerfile @@ -9,20 +9,21 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with SQLite3 database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -32,8 +33,30 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/zabbix/zabbix_proxy.conf"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="bash \ + tini \ + fping \ + iputils \ + libcurl \ + libevent \ + libldap \ + libssh \ + libxml2 \ + net-snmp-agent-libs \ + openipmi-libs \ + pcre \ + sqlite-libs \ + unixodbc + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -46,6 +69,7 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/db_data && \ mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /var/lib/zabbix/mibs && \ mkdir -p /var/lib/zabbix/modules && \ mkdir -p /var/lib/zabbix/snmptraps && \ @@ -54,22 +78,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 && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - apk add --clean-protected --no-cache \ - tini \ - bash \ - fping \ - iputils \ - libcurl \ - libevent \ - libldap \ - libssh \ - libxml2 \ - net-snmp-agent-libs \ - openipmi-libs \ - pcre \ - sqlite-libs \ - unixodbc && \ 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/ && \ diff --git a/Dockerfiles/proxy-sqlite3/centos/Dockerfile b/Dockerfiles/proxy-sqlite3/centos/Dockerfile index 7650c611b..2f2ec02ad 100644 --- a/Dockerfiles/proxy-sqlite3/centos/Dockerfile +++ b/Dockerfiles/proxy-sqlite3/centos/Dockerfile @@ -5,25 +5,25 @@ ARG BUILD_BASE_IMAGE=zabbix-build-sqlite3:centos-${ZBX_VERSION} FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with SQLite3 database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -33,28 +33,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/zabbix/zabbix_proxy.conf"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/db_data && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-proxy-sqlite3 && \ REPOLIST="baseos,appstream,epel" && \ INSTALL_PKGS="libevent \ tini \ @@ -72,12 +50,38 @@ RUN set -eux && \ unixODBC" && \ dnf -y install epel-release && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/db_data && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + 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 /etc/zabbix/ /var/lib/zabbix/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \ diff --git a/Dockerfiles/proxy-sqlite3/ol/Dockerfile b/Dockerfiles/proxy-sqlite3/ol/Dockerfile index faf7fac0a..76cec671e 100644 --- a/Dockerfiles/proxy-sqlite3/ol/Dockerfile +++ b/Dockerfiles/proxy-sqlite3/ol/Dockerfile @@ -9,21 +9,21 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with SQLite3 database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -34,28 +34,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/ COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/db_data && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-proxy-sqlite3 && \ INSTALL_PKGS="libevent \ tini \ libssh \ @@ -71,13 +49,40 @@ RUN set -eux && \ zlib \ unixODBC" && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/db_data && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + 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 /etc/zabbix/ /var/lib/zabbix/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \ diff --git a/Dockerfiles/proxy-sqlite3/rhel/Dockerfile b/Dockerfiles/proxy-sqlite3/rhel/Dockerfile index c83b022d5..9766770d2 100644 --- a/Dockerfiles/proxy-sqlite3/rhel/Dockerfile +++ b/Dockerfiles/proxy-sqlite3/rhel/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-sqlite3:rhel-${ZBX_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git @@ -8,39 +9,40 @@ FROM ${BUILD_BASE_IMAGE} as builder FROM registry.access.redhat.com/ubi8/ubi-minimal -ARG MAJOR_VERSIO +ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL name="zabbix/zabbix-proxy-sqlite-trunk" \ +LABEL description="Zabbix proxy with SQLite3 database support" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-proxy-sqlite-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-proxy -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-sqlite-trunk:${ZBX_VERSION}" \ + summary="Zabbix proxy (SQLite3)" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix proxy (SQLite3)" \ - description="Zabbix proxy with SQLite3 database support" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-proxy -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-sqlite-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix proxy with SQLite3 database support" \ io.k8s.display-name="Zabbix proxy (SQLite3)" \ io.openshift.expose-services="10051:10051" \ io.openshift.tags="zabbix,zabbix-proxy,sqlite" \ - org.label-schema.name="zabbix-proxy-sqlite-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix proxy with SQLite3 database support" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix proxy with SQLite3 database support" \ + org.label-schema.docker.cmd="docker run --name zabbix-proxy -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-sqlite3-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-proxy-sqlite-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-proxy -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-proxy-sqlite3-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -50,7 +52,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get", "/u COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender", "/usr/bin/zabbix_sender"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/zabbix/zabbix_proxy.conf"] -RUN set -eux && INSTALL_PKGS="bash \ +RUN set -eux && \ + INSTALL_PKGS="bash \ tini \ shadow-utils \ fping \ @@ -69,19 +72,24 @@ RUN set -eux && INSTALL_PKGS="bash \ rpm -ivh /tmp/epel-release-latest-8.noarch.rpm && \ rm -rf /tmp/epel-release-latest-8.noarch.rpm && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "ubi-8-appstream" \ - --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "ubi-8-appstream" \ + --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ + --enablerepo "epel" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -99,10 +107,10 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix/ssl/certs && \ mkdir -p /var/lib/zabbix/ssl/keys && \ mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - microdnf -y clean all && \ 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/ && \ + microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/proxy-sqlite3/ubuntu/Dockerfile b/Dockerfiles/proxy-sqlite3/ubuntu/Dockerfile index 4076497ac..21946a908 100644 --- a/Dockerfiles/proxy-sqlite3/ubuntu/Dockerfile +++ b/Dockerfiles/proxy-sqlite3/ubuntu/Dockerfile @@ -9,21 +9,21 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/var/lib/snmp/mibs/ietf:/var/lib/snmp/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix proxy with SQLite3 database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix proxy (SQLite3)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -34,29 +34,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_proxy.conf", "/etc/ RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/db_data && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + INSTALL_PKGS="bash \ tini \ ca-certificates \ fping \ @@ -70,7 +48,37 @@ RUN set -eux && \ libssl1.1 \ libxml2 \ snmp-mibs-downloader \ - unixodbc && \ + unixodbc" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/db_data && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + 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 /etc/zabbix/ /var/lib/zabbix/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \ diff --git a/Dockerfiles/server-mysql/alpine/Dockerfile b/Dockerfiles/server-mysql/alpine/Dockerfile index a14c2e14d..57bc0990d 100644 --- a/Dockerfiles/server-mysql/alpine/Dockerfile +++ b/Dockerfiles/server-mysql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,20 +9,21 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -34,8 +34,32 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_server.conf", "/etc COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_server.sql.gz", "/usr/share/doc/zabbix-server-mysql/create.sql.gz"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="bash \ + tini \ + fping \ + tzdata \ + iputils \ + libcurl \ + libevent \ + libldap \ + libssh \ + libxml2 \ + mariadb-client \ + mariadb-connector-c \ + net-snmp-agent-libs \ + openipmi-libs \ + pcre \ + unixodbc" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -60,23 +84,6 @@ RUN set -eux && \ mkdir -p /var/lib/zabbix/ssl/keys && \ mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ mkdir -p /usr/share/doc/zabbix-server-mysql && \ - apk add --clean-protected --no-cache \ - tini \ - bash \ - fping \ - tzdata \ - iputils \ - libcurl \ - libevent \ - libldap \ - libssh \ - libxml2 \ - mariadb-client \ - mariadb-connector-c \ - net-snmp-agent-libs \ - openipmi-libs \ - pcre \ - unixodbc && \ 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/ && \ diff --git a/Dockerfiles/server-mysql/centos/Dockerfile b/Dockerfiles/server-mysql/centos/Dockerfile index 229c142aa..abcee5d95 100644 --- a/Dockerfiles/server-mysql/centos/Dockerfile +++ b/Dockerfiles/server-mysql/centos/Dockerfile @@ -2,29 +2,28 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -35,30 +34,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_server.conf", "/etc COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_server.sql.gz", "/usr/share/doc/zabbix-server-mysql/create.sql.gz"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root,dialout \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-mysql && \ - dnf -y module enable mysql && \ REPOLIST="baseos,appstream,epel" && \ INSTALL_PKGS="fping \ tini \ @@ -78,14 +53,43 @@ RUN set -eux && \ pcre \ zlib \ unixODBC" && \ + dnf -y module enable mysql && \ dnf -y install epel-release && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root,dialout \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-mysql && \ 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/ && \ diff --git a/Dockerfiles/server-mysql/ol/Dockerfile b/Dockerfiles/server-mysql/ol/Dockerfile index a1fa1bc65..aefeae0ea 100644 --- a/Dockerfiles/server-mysql/ol/Dockerfile +++ b/Dockerfiles/server-mysql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,21 +9,21 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -36,31 +35,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_server.sq COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root,dialout \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-mysql && \ - microdnf -y module enable mysql && \ - INSTALL_PKGS="fping \ + INSTALL_PKGS="bash \ + fping \ tini \ file-libs \ tzdata \ @@ -78,14 +54,44 @@ RUN set -eux && \ pcre \ zlib \ unixODBC" && \ + microdnf -y module enable mysql && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root,dialout \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-mysql && \ 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/ && \ diff --git a/Dockerfiles/server-mysql/rhel/Dockerfile b/Dockerfiles/server-mysql/rhel/Dockerfile index d13d4d098..95c726265 100644 --- a/Dockerfiles/server-mysql/rhel/Dockerfile +++ b/Dockerfiles/server-mysql/rhel/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -11,36 +11,37 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL name="zabbix/zabbix-server-mysql-trunk" \ +LABEL description="Zabbix server with MySQL database support" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-server-mysql-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-server --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-server-mysql-trunk:${ZBX_VERSION}" \ + summary="Zabbix server (MySQL)" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix server (MySQL)" \ - description="Zabbix server with MySQL database support" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-server --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-server-mysql-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix server with MySQL database support" \ io.k8s.display-name="Zabbix server (MySQL)" \ io.openshift.expose-services="10051:10051" \ io.openshift.tags="zabbix,zabbix-server,mysql" \ - org.label-schema.name="zabbix-server-mysql-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix server with MySQL database support" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix server with MySQL database support" \ + org.label-schema.docker.cmd="docker run --name zabbix-server --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-server-mysql-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-server-mysql-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-server --link mysql-server:mysql-server -p 10051:10051 -d registry.connect.redhat.com/zabbix/zabbix-server-mysql-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -51,7 +52,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/zabbix_sender/zabbix_sender COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/conf/zabbix_server.conf", "/etc/zabbix/zabbix_server.conf"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_server.sql.gz", "/usr/share/doc/zabbix-server-mysql/create.sql.gz"] -RUN set -eux && INSTALL_PKGS="bash \ +RUN set -eux && \ + INSTALL_PKGS="bash \ tini \ fping \ shadow-utils \ @@ -73,20 +75,25 @@ RUN set -eux && INSTALL_PKGS="bash \ rm -rf /tmp/epel-release-latest-8.noarch.rpm && \ microdnf -y module enable mysql && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "ubi-8-appstream" \ - --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ - --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "ubi-8-appstream" \ + --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ + --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ + --enablerepo "epel" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -95,6 +102,7 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix && \ mkdir -p /usr/lib/zabbix/alertscripts && \ mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /var/lib/zabbix/mibs && \ mkdir -p /var/lib/zabbix/modules && \ @@ -105,10 +113,10 @@ RUN set -eux && INSTALL_PKGS="bash \ mkdir -p /var/lib/zabbix/ssl/keys && \ mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ mkdir -p /usr/share/doc/zabbix-server-mysql && \ - microdnf -y clean all && \ 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/ && \ + microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/server-mysql/ubuntu/Dockerfile b/Dockerfiles/server-mysql/ubuntu/Dockerfile index 810219b32..a54ed4f6e 100644 --- a/Dockerfiles/server-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/server-mysql/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,21 +9,21 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/var/lib/snmp/mibs/ietf:/var/lib/snmp/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -36,31 +35,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/mysql/create_server.sq RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root,dialout \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-mysql && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + INSTALL_PKGS="bash \ tini \ tzdata \ ca-certificates \ @@ -78,7 +53,39 @@ RUN set -eux && \ libxml2 \ mysql-client \ snmp-mibs-downloader \ - unixodbc && \ + unixodbc" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root,dialout \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-mysql && \ 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/ && \ diff --git a/Dockerfiles/server-pgsql/alpine/Dockerfile b/Dockerfiles/server-pgsql/alpine/Dockerfile index d75cbb6d9..9184c08d5 100644 --- a/Dockerfiles/server-pgsql/alpine/Dockerfile +++ b/Dockerfiles/server-pgsql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,20 +9,21 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -35,35 +35,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/postgresql/create_serv COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/postgresql/timescaledb.sql", "/usr/share/doc/zabbix-server-postgresql/timescaledb.sql"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ - --gecos "Zabbix monitoring system" \ - --disabled-password \ - --uid 1997 \ - --ingroup zabbix \ - --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ - zabbix && \ - adduser zabbix root && \ - adduser zabbix dialout && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-postgresql && \ - apk add --clean-protected --no-cache \ + INSTALL_PKGS="bash \ tini \ - bash \ fping \ tzdata \ iputils \ @@ -77,7 +50,41 @@ RUN set -eux && \ pcre \ postgresql-client \ postgresql-libs \ - unixodbc && \ + unixodbc" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ + --gecos "Zabbix monitoring system" \ + --disabled-password \ + --uid 1997 \ + --ingroup zabbix \ + --shell /sbin/nologin \ + --home /var/lib/zabbix/ \ + zabbix && \ + adduser zabbix root && \ + adduser zabbix dialout && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-postgresql && \ 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/ && \ diff --git a/Dockerfiles/server-pgsql/centos/Dockerfile b/Dockerfiles/server-pgsql/centos/Dockerfile index ad86f2195..1d4160de1 100644 --- a/Dockerfiles/server-pgsql/centos/Dockerfile +++ b/Dockerfiles/server-pgsql/centos/Dockerfile @@ -2,28 +2,28 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -35,29 +35,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/postgresql/create_serv COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/postgresql/timescaledb.sql", "/usr/share/doc/zabbix-server-postgresql/timescaledb.sql"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root,dialout \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-postgresql && \ REPOLIST="baseos,appstream,epel" && \ INSTALL_PKGS="fping \ file-libs \ @@ -79,12 +56,40 @@ RUN set -eux && \ unixODBC" && \ dnf -y install epel-release && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root,dialout \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-postgresql && \ 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/ && \ diff --git a/Dockerfiles/server-pgsql/ol/Dockerfile b/Dockerfiles/server-pgsql/ol/Dockerfile index f210cab63..6199a8a6d 100644 --- a/Dockerfiles/server-pgsql/ol/Dockerfile +++ b/Dockerfiles/server-pgsql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,9 +9,10 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL LABEL org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ @@ -36,29 +36,6 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/postgresql/timescaledb COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root,dialout \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-postgresql && \ INSTALL_PKGS="fping \ file-libs \ tini \ @@ -78,13 +55,42 @@ RUN set -eux && \ zlib \ unixODBC" && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root,dialout \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-postgresql && \ 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/ && \ diff --git a/Dockerfiles/server-pgsql/ubuntu/Dockerfile b/Dockerfiles/server-pgsql/ubuntu/Dockerfile index 8f2ab6710..60e891115 100644 --- a/Dockerfiles/server-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/server-pgsql/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,21 +9,21 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ENV TERM=xterm \ ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/var/lib/snmp/mibs/ietf:/var/lib/snmp/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL -LABEL org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix server (PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -37,31 +36,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/database/postgresql/timescaledb RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root,dialout \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/export && \ - mkdir -p /var/lib/zabbix/mibs && \ - mkdir -p /var/lib/zabbix/modules && \ - mkdir -p /var/lib/zabbix/snmptraps && \ - mkdir -p /var/lib/zabbix/ssh_keys && \ - mkdir -p /var/lib/zabbix/ssl && \ - mkdir -p /var/lib/zabbix/ssl/certs && \ - mkdir -p /var/lib/zabbix/ssl/keys && \ - mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ - mkdir -p /usr/lib/zabbix/alertscripts && \ - mkdir -p /usr/lib/zabbix/externalscripts && \ - mkdir -p /usr/share/doc/zabbix-server-postgresql && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + INSTALL_PKGS="bash \ tini \ tzdata \ ca-certificates \ @@ -79,7 +54,39 @@ RUN set -eux && \ libxml2 \ postgresql-client \ snmp-mibs-downloader \ - unixodbc && \ + unixodbc" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root,dialout \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /usr/lib/zabbix/alertscripts && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/export && \ + mkdir -p /usr/lib/zabbix/externalscripts && \ + mkdir -p /var/lib/zabbix/mibs && \ + mkdir -p /var/lib/zabbix/modules && \ + mkdir -p /var/lib/zabbix/snmptraps && \ + mkdir -p /var/lib/zabbix/ssh_keys && \ + mkdir -p /var/lib/zabbix/ssl && \ + mkdir -p /var/lib/zabbix/ssl/certs && \ + mkdir -p /var/lib/zabbix/ssl/keys && \ + mkdir -p /var/lib/zabbix/ssl/ssl_ca && \ + mkdir -p /usr/share/doc/zabbix-server-postgresql && \ 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/ && \ diff --git a/Dockerfiles/snmptraps/alpine/Dockerfile b/Dockerfiles/snmptraps/alpine/Dockerfile index 17d3d4720..e5991fc56 100644 --- a/Dockerfiles/snmptraps/alpine/Dockerfile +++ b/Dockerfiles/snmptraps/alpine/Dockerfile @@ -4,24 +4,36 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +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%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" -LABEL org.opencontainers.image.title="zabbix-snmptraps-alpine" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="zabbix-snmptraps" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="bash \ + tzdata \ + net-snmp" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -30,15 +42,10 @@ RUN set -eux && \ --home /var/lib/zabbix/ \ zabbix && \ adduser zabbix root && \ - apk update && \ - apk add --clean-protected --no-cache \ - bash \ - tzdata \ - net-snmp && \ - touch /var/lib/net-snmp/snmptrapd.conf && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/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/ && \ diff --git a/Dockerfiles/snmptraps/centos/Dockerfile b/Dockerfiles/snmptraps/centos/Dockerfile index 38d773629..c43f4fc63 100644 --- a/Dockerfiles/snmptraps/centos/Dockerfile +++ b/Dockerfiles/snmptraps/centos/Dockerfile @@ -4,41 +4,47 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +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%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" -LABEL org.opencontainers.image.title="zabbix-snmptraps-centos" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="zabbix-snmptraps" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ REPOLIST="baseos,appstream" && \ INSTALL_PKGS="bash \ tzdata \ net-snmp" && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/mibs && \ diff --git a/Dockerfiles/snmptraps/ol/Dockerfile b/Dockerfiles/snmptraps/ol/Dockerfile index ebf03048e..61e169983 100644 --- a/Dockerfiles/snmptraps/ol/Dockerfile +++ b/Dockerfiles/snmptraps/ol/Dockerfile @@ -4,40 +4,47 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +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%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" -LABEL org.opencontainers.image.title="zabbix-snmptraps-ol" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="zabbix-snmptraps" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ INSTALL_PKGS="bash \ tzdata \ net-snmp" && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/mibs && \ diff --git a/Dockerfiles/snmptraps/rhel/Dockerfile b/Dockerfiles/snmptraps/rhel/Dockerfile index 102349452..7024f7de7 100644 --- a/Dockerfiles/snmptraps/rhel/Dockerfile +++ b/Dockerfiles/snmptraps/rhel/Dockerfile @@ -1,5 +1,4 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal -MAINTAINER Alexey Pustovalov ARG MAJOR_VERSION=6.0 ARG RELEASE= @@ -7,35 +6,36 @@ ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +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%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" -LABEL name="zabbix/zabbix-snmptraps-trunk" \ +LABEL description="Zabbix SNMP traps receiver" \ maintainer="alexey.pustovalov@zabbix.com" \ + name="zabbix/zabbix-snmptraps-trunk" \ + release="${RELEASE}" \ + run="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:1162/udp -d registry.connect.redhat.com/zabbix/zabbix-snmptraps-trunk:${ZBX_VERSION}" \ + summary="Zabbix SNMP traps receiver" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix SNMP traps receiver" \ - description="Zabbix SNMP traps receiver" \ - url="https://www.zabbix.com/" \ - run="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:1162/udp -d registry.connect.redhat.com/zabbix/zabbix-snmptraps-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix SNMP traps receiver" \ io.k8s.display-name="Zabbix SNMP traps receiver" \ io.openshift.expose-services="162:1162" \ io.openshift.tags="zabbix,zabbix-snmp,snmp-traps" \ - org.label-schema.name="zabbix-snmptraps-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix SNMP traps receiver" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + org.label-schema.description="Zabbix SNMP traps receiver" \ + org.label-schema.docker.cmd="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:1162/udp -d registry.connect.redhat.com/zabbix/zabbix-snmptraps-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-snmptraps-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:1162/udp -d registry.connect.redhat.com/zabbix/zabbix-snmptraps-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -47,17 +47,22 @@ RUN set -eux && \ tzdata \ net-snmp" && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="rhel-8-for-x86_64-baseos-rpms" \ - --enablerepo="rhel-8-for-x86_64-appstream-rpms" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo="*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "ubi-8-appstream" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ diff --git a/Dockerfiles/snmptraps/ubuntu/Dockerfile b/Dockerfiles/snmptraps/ubuntu/Dockerfile index 08b117fc2..184454059 100644 --- a/Dockerfiles/snmptraps/ubuntu/Dockerfile +++ b/Dockerfiles/snmptraps/ubuntu/Dockerfile @@ -4,38 +4,45 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/var/lib/snmp/mibs/ietf:/var/lib/snmp/mibs/iana:/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ ZBX_SNMP_TRAP_DATE_FORMAT=+%Y%m%d.%H%M%S ZBX_SNMP_TRAP_FORMAT="\n" -LABEL org.opencontainers.image.title="zabbix-snmptraps-ubuntu" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix SNMP traps receiver" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.title="zabbix-snmptraps" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + tzdata \ + snmp-mibs-downloader \ + snmptrapd" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ zabbix && \ - apt-get -y update && \ - INSTALL_PKGS="tzdata \ - snmp-mibs-downloader \ - snmptrapd" && \ - DEBIAN_FRONTEND=noninteractive apt-get -y \ - --no-install-recommends install \ - ${INSTALL_PKGS} && \ download-mibs && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ diff --git a/Dockerfiles/web-apache-mysql/alpine/Dockerfile b/Dockerfiles/web-apache-mysql/alpine/Dockerfile index 36ca9f1dd..5718bcb6b 100644 --- a/Dockerfiles/web-apache-mysql/alpine/Dockerfile +++ b/Dockerfiles/web-apache-mysql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,21 +30,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ - --gecos "Zabbix monitoring system" \ - --disabled-password \ - --uid 1997 \ - --ingroup zabbix \ - --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ - zabbix && \ - adduser zabbix root && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - apk add --clean-protected --no-cache \ + INSTALL_PKGS="bash \ apache2 \ - bash \ curl \ mariadb-client \ mariadb-connector-c \ @@ -63,16 +50,41 @@ RUN set -eux && \ php7-fileinfo \ php7-xmlreader \ php7-xmlwriter \ - php7-openssl && \ - apk add --clean-protected --no-cache --no-scripts apache2-ssl && \ + php7-openssl" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + apk add \ + --clean-protected \ + --no-cache \ + --no-scripts \ + apache2-ssl && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ + --gecos "Zabbix monitoring system" \ + --disabled-password \ + --uid 1997 \ + --ingroup zabbix \ + --shell /sbin/nologin \ + --home /var/lib/zabbix/ \ + zabbix && \ + adduser zabbix root && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/web/certs && \ rm -f "/etc/apache2/conf.d/default.conf" && \ rm -f "/etc/apache2/conf.d/ssl.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' \ + -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/apache2/httpd.conf" && \ sed -ri \ - -e 's!^(\s*PidFile)\s+\S+!\1 "/tmp/httpd.pid"!g' \ + -e 's!^(\s*PidFile)\s+\S+!\1 "/tmp/httpd.pid"!g' \ "/etc/apache2/conf.d/mpm.conf" && \ sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/httpd.conf && \ rm -rf "/var/run/apache2/" && \ diff --git a/Dockerfiles/web-apache-mysql/centos/Dockerfile b/Dockerfiles/web-apache-mysql/centos/Dockerfile index 02a8457be..01beb2057 100644 --- a/Dockerfiles/web-apache-mysql/centos/Dockerfile +++ b/Dockerfiles/web-apache-mysql/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,21 +30,9 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ - dnf -y module enable mysql && \ - dnf -y module enable php:7.4 && \ REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="curl \ + INSTALL_PKGS="bash \ + curl \ httpd \ mysql \ mod_ssl \ @@ -61,19 +49,37 @@ RUN set -eux && \ glibc-locale-source \ supervisor" && \ dnf -y install epel-release && \ + dnf -y module enable mysql && \ + dnf -y module enable php:7.4 && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/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 && \ 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' \ + -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 && \ cd /usr/share/zabbix/ && \ @@ -85,20 +91,17 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /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/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ dnf -y remove \ findutils \ glibc-locale-source && \ diff --git a/Dockerfiles/web-apache-mysql/ol/Dockerfile b/Dockerfiles/web-apache-mysql/ol/Dockerfile index 410e44b3a..761b2c9a9 100644 --- a/Dockerfiles/web-apache-mysql/ol/Dockerfile +++ b/Dockerfiles/web-apache-mysql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,20 +31,8 @@ COPY ["conf/etc/", "/etc/"] COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ - microdnf -y module enable mysql && \ - microdnf -y module enable php:7.4 && \ - INSTALL_PKGS="curl \ + INSTALL_PKGS="bash \ + curl \ httpd \ mysql \ mod_ssl \ @@ -60,20 +48,39 @@ RUN set -eux && \ findutils \ glibc-locale-source \ supervisor" && \ + microdnf -y module enable mysql && \ + microdnf -y module enable php:7.4 && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/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 && \ 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' \ + -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 && \ cd /usr/share/zabbix/ && \ @@ -85,20 +92,17 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /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/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ microdnf -y remove \ findutils \ glibc-locale-source && \ diff --git a/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile b/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile index 96f63cc09..e705db526 100644 --- a/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/web-apache-mysql/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,18 +31,7 @@ COPY ["conf/etc/", "/etc/"] RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + INSTALL_PKGS="bash \ apache2 \ curl \ libapache2-mod-php \ @@ -55,18 +44,38 @@ RUN set -eux && \ php7.4-ldap \ php7.4-mbstring \ php7.4-mysql \ - php7.4-xml && \ + php7.4-xml" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/web/certs && \ rm -f /etc/apache2/sites-available/* && \ rm -f /etc/apache2/sites-enabled/* && \ /usr/sbin/a2enmod ssl && \ 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/apache2/apache2.conf" && \ + "/etc/apache2/apache2.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/apache2/conf-available/other-vhosts-access-log.conf" && \ + "/etc/apache2/conf-available/other-vhosts-access-log.conf" && \ sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf && \ sed -i 's/Listen 443/Listen 8443/g' /etc/apache2/ports.conf && \ sed -i 's|/var/run/apache2$SUFFIX|/tmp|g' /etc/apache2/envvars && \ @@ -82,18 +91,15 @@ RUN set -eux && \ 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' && \ + 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/apache2/ /etc/php/7.4/ && \ chgrp -R 0 /etc/apache2/ /etc/php/7.4/ && \ chmod -R g=u /etc/apache2/ /etc/php/7.4/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfiles/web-apache-pgsql/alpine/Dockerfile b/Dockerfiles/web-apache-pgsql/alpine/Dockerfile index 7a752880d..d857570df 100644 --- a/Dockerfiles/web-apache-pgsql/alpine/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,21 +30,8 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ - --gecos "Zabbix monitoring system" \ - --disabled-password \ - --uid 1997 \ - --ingroup zabbix \ - --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ - zabbix && \ - adduser zabbix root && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - apk add --clean-protected --no-cache \ + INSTALL_PKGS="bash \ apache2 \ - bash \ curl \ php7-apache2 \ php7-bcmath \ @@ -62,16 +49,41 @@ RUN set -eux && \ php7-xmlreader \ php7-xmlwriter \ php7-openssl \ - postgresql-client && \ - apk add --clean-protected --no-cache --no-scripts apache2-ssl && \ + postgresql-client" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + apk add \ + --clean-protected \ + --no-cache \ + --no-scripts \ + apache2-ssl && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ + --gecos "Zabbix monitoring system" \ + --disabled-password \ + --uid 1997 \ + --ingroup zabbix \ + --shell /sbin/nologin \ + --home /var/lib/zabbix/ \ + zabbix && \ + adduser zabbix root && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/web/certs && \ rm -f "/etc/apache2/conf.d/default.conf" && \ rm -f "/etc/apache2/conf.d/ssl.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' \ + -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/apache2/httpd.conf" && \ sed -ri \ - -e 's!^(\s*PidFile)\s+\S+!\1 "/tmp/httpd.pid"!g' \ + -e 's!^(\s*PidFile)\s+\S+!\1 "/tmp/httpd.pid"!g' \ "/etc/apache2/conf.d/mpm.conf" && \ sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/httpd.conf && \ rm -rf "/var/run/apache2/" && \ diff --git a/Dockerfiles/web-apache-pgsql/centos/Dockerfile b/Dockerfiles/web-apache-pgsql/centos/Dockerfile index c23b42112..0595c9b32 100644 --- a/Dockerfiles/web-apache-pgsql/centos/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,20 +30,9 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ - dnf -y module enable php:7.4 && \ REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="curl \ + INSTALL_PKGS="bash \ + curl \ httpd \ mod_ssl \ php \ @@ -60,19 +49,36 @@ RUN set -eux && \ glibc-locale-source \ supervisor" && \ dnf -y install epel-release && \ + dnf -y module enable php:7.4 && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/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 && \ 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' \ + -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 && \ cd /usr/share/zabbix/ && \ @@ -84,20 +90,17 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /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/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ dnf -y remove \ findutils \ glibc-locale-source && \ diff --git a/Dockerfiles/web-apache-pgsql/ol/Dockerfile b/Dockerfiles/web-apache-pgsql/ol/Dockerfile index 30269a7da..ba2c8eddb 100644 --- a/Dockerfiles/web-apache-pgsql/ol/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,19 +31,8 @@ COPY ["conf/etc/", "/etc/"] COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /etc/zabbix/web/certs && \ - microdnf -y module enable php:7.4 && \ - INSTALL_PKGS="curl \ + INSTALL_PKGS="bash \ + curl \ httpd \ mod_ssl \ php \ @@ -59,20 +48,38 @@ RUN set -eux && \ findutils \ glibc-locale-source \ supervisor" && \ + microdnf -y module enable php:7.4 && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/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 && \ 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' \ + -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 && \ cd /usr/share/zabbix/ && \ @@ -84,20 +91,17 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /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/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ microdnf -y remove \ findutils \ glibc-locale-source && \ diff --git a/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile b/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile index 9c775a538..b5d477fb9 100644 --- a/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/web-apache-pgsql/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,18 +31,7 @@ COPY ["conf/etc/", "/etc/"] RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + INSTALL_PKGS="bash \ apache2 \ curl \ libapache2-mod-php \ @@ -55,18 +44,38 @@ RUN set -eux && \ php7.4-mbstring \ php7.4-xml \ php7.4-pgsql \ - postgresql-client && \ + postgresql-client" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/web/certs && \ rm -f /etc/apache2/sites-available/* && \ rm -f /etc/apache2/sites-enabled/* && \ /usr/sbin/a2enmod ssl && \ 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/apache2/apache2.conf" && \ + "/etc/apache2/apache2.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/apache2/conf-available/other-vhosts-access-log.conf" && \ + "/etc/apache2/conf-available/other-vhosts-access-log.conf" && \ sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf && \ sed -i 's/Listen 443/Listen 8443/g' /etc/apache2/ports.conf && \ sed -i 's|/var/run/apache2$SUFFIX|/tmp|g' /etc/apache2/envvars && \ @@ -82,20 +91,15 @@ RUN set -eux && \ 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' && \ + cut -d"'" -f 2 | sort | \ + xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ dpkg-reconfigure locales && \ - find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ - find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ - chown --quiet -R zabbix:root /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/apache2/ /etc/php/7.4/ && \ chgrp -R 0 /etc/apache2/ /etc/php/7.4/ && \ chmod -R g=u /etc/apache2/ /etc/php/7.4/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfiles/web-nginx-mysql/alpine/Dockerfile b/Dockerfiles/web-nginx-mysql/alpine/Dockerfile index 0a227109f..5a3165b13 100644 --- a/Dockerfiles/web-nginx-mysql/alpine/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,21 +30,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ - --gecos "Zabbix monitoring system" \ - --disabled-password \ - --uid 1997 \ - --ingroup zabbix \ - --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ - zabbix && \ - adduser zabbix root && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /var/lib/php/session && \ - apk add --clean-protected --no-cache \ - bash \ + INSTALL_PKGS="bash \ curl \ mariadb-client \ mariadb-connector-c \ @@ -65,7 +51,34 @@ RUN set -eux && \ php7-xmlreader \ php7-xmlwriter \ php7-openssl \ - supervisor && \ + supervisor" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + apk add \ + --clean-protected \ + --no-cache \ + --no-scripts \ + apache2-ssl && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ + --gecos "Zabbix monitoring system" \ + --disabled-password \ + --uid 1997 \ + --ingroup zabbix \ + --shell /sbin/nologin \ + --home /var/lib/zabbix/ \ + zabbix && \ + adduser zabbix root && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/web/certs && \ + mkdir -p /var/lib/php/session && \ rm -rf /etc/php7/php-fpm.d/www.conf && \ rm -f /etc/nginx/http.d/*.conf && \ ln -sf /dev/fd/2 /var/lib/nginx/logs/error.log && \ diff --git a/Dockerfiles/web-nginx-mysql/centos/Dockerfile b/Dockerfiles/web-nginx-mysql/centos/Dockerfile index aa786d092..d4b9174e4 100644 --- a/Dockerfiles/web-nginx-mysql/centos/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,22 +30,9 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --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 /var/lib/php/session && \ - dnf -y module enable mysql && \ - dnf -y module enable php:7.4 nginx:1.18 && \ REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="curl \ + INSTALL_PKGS="bash \ + curl \ mysql \ nginx \ php-bcmath \ @@ -60,13 +47,32 @@ RUN set -eux && \ glibc-locale-source \ supervisor" && \ dnf -y install epel-release && \ + dnf -y module enable mysql && \ + dnf -y module enable php:7.4 nginx:1.18 && \ dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --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 /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/php-fpm.d/www.conf && \ cd /usr/share/zabbix/ && \ @@ -78,23 +84,20 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ dnf -y remove \ - findutils \ - glibc-locale-source && \ + findutils \ + glibc-locale-source && \ dnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/web-nginx-mysql/ol/Dockerfile b/Dockerfiles/web-nginx-mysql/ol/Dockerfile index 6049b0490..4a0883e06 100644 --- a/Dockerfiles/web-nginx-mysql/ol/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,21 +31,8 @@ COPY ["conf/etc/", "/etc/"] COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --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 /var/lib/php/session && \ - microdnf -y module enable mysql && \ - microdnf -y module enable php:7.4 && \ - INSTALL_PKGS="curl \ + INSTALL_PKGS="bash \ + curl \ mysql \ nginx \ php-bcmath \ @@ -59,14 +46,34 @@ RUN set -eux && \ findutils \ glibc-locale-source \ supervisor" && \ + microdnf -y module enable mysql && \ + microdnf -y module enable php:7.4 && \ microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --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 /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/php-fpm.d/www.conf && \ cd /usr/share/zabbix/ && \ @@ -78,23 +85,20 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ microdnf -y remove \ - findutils \ - glibc-locale-source && \ + findutils \ + glibc-locale-source && \ microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/web-nginx-mysql/rhel/Dockerfile b/Dockerfiles/web-nginx-mysql/rhel/Dockerfile index 485a7fced..782f2ddfa 100644 --- a/Dockerfiles/web-nginx-mysql/rhel/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/rhel/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -11,35 +11,36 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL name="zabbix/zabbix-web-mysql" \ +LABEL description="Zabbix web-interface based on Nginx web server with MySQL database support" \ maintainer="alexey.pustovalov@zabbix.com" \ + 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-trunk:${ZBX_VERSION}" \ + summary="Zabbix web-interface based on Nginx web server with MySQL database support" \ + url="https://www.zabbix.com/" \ vendor="Zabbix LLC" \ version="${MAJOR_VERSION}" \ - release="${RELEASE}" \ - summary="Zabbix web-interface based on Nginx web server with MySQL database support" \ - description="Zabbix web-interface based on Nginx web server with MySQL database support" \ - url="https://www.zabbix.com/" \ - 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-trunk:${ZBX_VERSION}" \ io.k8s.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ io.k8s.display-name="Zabbix Frontend (Nginx)" \ io.openshift.expose-services="8080:http,8443:https" \ io.openshift.tags="zabbix,zabbix-web,mysql,nginx" \ - org.label-schema.name="zabbix-web-mysql-rhel" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ - org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ + 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-trunk:${ZBX_VERSION}" \ org.label-schema.license="GPL v2.0" \ + org.label-schema.name="zabbix-web-mysql-rhel" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.url="https://zabbix.com/" \ org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.vcs-url="${ZBX_SOURCES}" \ - 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-trunk:${ZBX_VERSION}" + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -47,7 +48,8 @@ COPY ["licenses", "/licenses"] COPY ["conf/etc/", "/etc/"] COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] -RUN set -eux && INSTALL_PKGS="bash \ +RUN set -eux && \ + INSTALL_PKGS="bash \ tzdata \ curl \ supervisor \ @@ -70,20 +72,25 @@ RUN set -eux && INSTALL_PKGS="bash \ microdnf -y module enable mysql && \ microdnf -y module enable php:7.4 nginx:1.18 && \ microdnf -y install \ - --disablerepo "*" \ - --enablerepo "ubi-8-baseos" \ - --enablerepo "ubi-8-appstream" \ - --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ - --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ - --enablerepo "epel" \ - --setopt=install_weak_deps=0 \ - --best \ - --setopt=tsflags=nodocs \ + --disablerepo "*" \ + --enablerepo "ubi-8-baseos" \ + --enablerepo "ubi-8-appstream" \ + --enablerepo "rhel-8-for-x86_64-baseos-rpms" \ + --enablerepo "rhel-8-for-x86_64-appstream-rpms" \ + --enablerepo "epel" \ + --setopt=install_weak_deps=0 \ + --best \ + --setopt=tsflags=nodocs \ ${INSTALL_PKGS} && \ - groupadd --system --gid 1995 zabbix && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -103,23 +110,20 @@ RUN set -eux && INSTALL_PKGS="bash \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ microdnf -y remove \ - findutils \ - glibc-locale-source && \ + findutils \ + glibc-locale-source && \ microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile b/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile index c02e19d8d..cf04f175a 100644 --- a/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/web-nginx-mysql/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with MySQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, MySQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,23 +31,28 @@ COPY ["conf/etc/", "/etc/"] RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /var/lib/php/session && \ + INSTALL_PKGS="bash \ + ca-certificates \ + curl \ + mysql-client \ + nginx \ + locales \ + php7.4-bcmath \ + php7.4-fpm \ + php7.4-gd \ + php7.4-json \ + php7.4-ldap \ + php7.4-mbstring \ + php7.4-mysql \ + php7.4-xml \ + supervisor" && \ + INSTALL_TEMP_PKGS="gpg \ + dirmngr \ + gpg-agent" && \ apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - gpg \ - dirmngr \ - gpg-agent \ - ca-certificates && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_TEMP_PKGS} && \ NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \ found=''; \ for server in \ @@ -63,27 +68,33 @@ RUN set -eux && \ DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \ echo "deb https://nginx.org/packages/ubuntu/ $DISTRIB_CODENAME nginx" >> /etc/apt/sources.list.d/nginx.list && \ apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends \ - -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install \ - curl \ - mysql-client \ - nginx \ - locales \ - php7.4-bcmath \ - php7.4-fpm \ - php7.4-gd \ - php7.4-json \ - php7.4-ldap \ - php7.4-mbstring \ - php7.4-mysql \ - php7.4-xml \ - supervisor && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + -o Dpkg::Options::="--force-confdef" \ + -o Dpkg::Options::="--force-confold" \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --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 /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ rm -rf /var/cache/nginx/ && \ rm -f /etc/php/7.4/fpm/pool.d/www.conf && \ ln -sf /dev/fd/2 /var/log/nginx/error.log && \ rm -f /etc/php/7.4/fpm/php-fpm.conf.dpkg-dist && \ - DEBIAN_FRONTEND=noninteractive apt-get -y purge gpg dirmngr gpg-agent && \ cd /usr/share/zabbix/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ @@ -95,11 +106,9 @@ RUN set -eux && \ 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' && \ + cut -d"'" -f 2 | sort | \ + xargs -I '{}' bash -c 'echo "{}.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local' && \ dpkg-reconfigure locales && \ - find /usr/share/zabbix/locale -name '*.po' | xargs rm -f && \ - find /usr/share/zabbix/locale -name '*.sh' | xargs rm -f && \ 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/ && \ @@ -109,6 +118,9 @@ RUN set -eux && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + purge \ + ${INSTALL_TEMP_PKGS} && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile b/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile index 4c581cfc4..d7dfe10da 100644 --- a/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,21 +30,7 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ - --gecos "Zabbix monitoring system" \ - --disabled-password \ - --uid 1997 \ - --ingroup zabbix \ - --shell /sbin/nologin \ - --home /var/lib/zabbix/ \ - zabbix && \ - adduser zabbix root && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /var/lib/php/session && \ - apk add --clean-protected --no-cache \ - bash \ + INSTALL_PKGS="bash \ curl \ nginx \ php7-bcmath \ @@ -64,7 +50,34 @@ RUN set -eux && \ php7-xmlwriter \ php7-openssl \ postgresql-client \ - supervisor && \ + supervisor" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + apk add \ + --clean-protected \ + --no-cache \ + --no-scripts \ + apache2-ssl && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ + --gecos "Zabbix monitoring system" \ + --disabled-password \ + --uid 1997 \ + --ingroup zabbix \ + --shell /sbin/nologin \ + --home /var/lib/zabbix/ \ + zabbix && \ + adduser zabbix root && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/web && \ + mkdir -p /etc/zabbix/web/certs && \ + mkdir -p /var/lib/php/session && \ rm -rf /etc/php7/php-fpm.d/www.conf && \ rm -f /etc/nginx/http.d/*.conf && \ ln -sf /dev/fd/2 /var/lib/nginx/logs/error.log && \ diff --git a/Dockerfiles/web-nginx-pgsql/centos/Dockerfile b/Dockerfiles/web-nginx-pgsql/centos/Dockerfile index 58229c422..eb6d1e3aa 100644 --- a/Dockerfiles/web-nginx-pgsql/centos/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/centos/Dockerfile @@ -2,27 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,10 +30,40 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/ui", "/usr/share/zabbix"] COPY ["conf/etc/", "/etc/"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + REPOLIST="baseos,appstream,epel" && \ + INSTALL_PKGS="bash \ + curl \ + findutils \ + glibc-locale-source \ + nginx \ + php-bcmath \ + php-fpm \ + php-gd \ + php-json \ + php-ldap \ + php-mbstring \ + php-pgsql \ + php-xml + postgresql \ + supervisor" && \ + dnf -y install epel-release && \ + dnf -y module enable php:7.4 nginx:1.18 && \ + dnf -y install \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -42,30 +72,6 @@ RUN set -eux && \ mkdir -p /etc/zabbix/web && \ mkdir -p /etc/zabbix/web/certs && \ mkdir -p /var/lib/php/session && \ - dnf -y module enable php:7.4 nginx:1.18 && \ - REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="supervisor \ - curl \ - nginx \ - postgresql \ - php-bcmath \ - php-fpm \ - php-gd \ - php-ldap \ - php-mbstring \ - php-pgsql \ - php-json \ - findutils \ - glibc-locale-source \ - php-xml" && \ - dnf -y install epel-release && \ - dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ - ${INSTALL_PKGS} && \ rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/php-fpm.d/www.conf && \ cd /usr/share/zabbix/ && \ @@ -77,23 +83,20 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ dnf -y remove \ - findutils \ - glibc-locale-source && \ + findutils \ + glibc-locale-source && \ dnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/web-nginx-pgsql/ol/Dockerfile b/Dockerfiles/web-nginx-pgsql/ol/Dockerfile index 62f23bb4d..472c666a8 100644 --- a/Dockerfiles/web-nginx-pgsql/ol/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-pgsql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,10 +31,40 @@ COPY ["conf/etc/", "/etc/"] COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + curl \ + findutils \ + glibc-locale-source \ + nginx \ + php-bcmath \ + php-fpm \ + php-gd \ + php-json \ + php-ldap \ + php-mbstring \ + php-pgsql \ + php-xml + postgresql \ + supervisor" && \ + microdnf -y module enable php:7.4 && \ + microdnf -y install \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -43,29 +73,6 @@ RUN set -eux && \ mkdir -p /etc/zabbix/web && \ mkdir -p /etc/zabbix/web/certs && \ mkdir -p /var/lib/php/session && \ - microdnf -y module enable php:7.4 && \ - INSTALL_PKGS="supervisor \ - curl \ - nginx \ - postgresql \ - php-bcmath \ - php-fpm \ - php-gd \ - php-ldap \ - php-mbstring \ - php-pgsql \ - php-json \ - findutils \ - glibc-locale-source \ - php-xml" && \ - microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ rm -f /etc/nginx/conf.d/*.conf && \ rm -f /etc/php-fpm.d/www.conf && \ cd /usr/share/zabbix/ && \ @@ -77,23 +84,20 @@ RUN set -eux && \ 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" && \ 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/modules/ && \ - chgrp -R 0 /etc/zabbix/ /usr/share/zabbix/modules/ && \ - chmod -R g=u /etc/zabbix/ /usr/share/zabbix/modules/ && \ + 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 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chgrp -R 0 /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chmod -R g=u /etc/nginx/ /etc/php-fpm.d/ /etc/php-fpm.conf && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ - chown --quiet -R zabbix:root /usr/share/zabbix/include/defines.inc.php && \ - chgrp -R 0 /usr/share/zabbix/include/defines.inc.php && \ - chmod -R g=u /usr/share/zabbix/include/defines.inc.php && \ microdnf -y remove \ - findutils \ - glibc-locale-source && \ + findutils \ + glibc-locale-source && \ microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile b/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile index 6bf2807f4..e32521638 100644 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,19 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web-interface based on Nginx web server with PostgreSQL database support" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web-interface (Nginx, PostgreSQL)" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -31,23 +31,28 @@ COPY ["conf/etc/", "/etc/"] RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/web && \ - mkdir -p /var/lib/php/session && \ + INSTALL_PKGS="bash \ + ca-certificates \ + curl \ + nginx \ + locales \ + php7.4-bcmath \ + php7.4-fpm \ + php7.4-gd \ + php7.4-json \ + php7.4-ldap \ + php7.4-mbstring \ + php7.4-xml \ + php7.4-pgsql \ + postgresql-client \ + supervisor" && \ + INSTALL_TEMP_PKGS="gpg \ + dirmngr \ + gpg-agent" && \ apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - gpg \ - dirmngr \ - gpg-agent \ - ca-certificates && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_TEMP_PKGS} && \ NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \ found=''; \ for server in \ @@ -63,27 +68,33 @@ RUN set -eux && \ DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \ echo "deb https://nginx.org/packages/ubuntu/ $DISTRIB_CODENAME nginx" >> /etc/apt/sources.list.d/nginx.list && \ apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends \ - -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install \ - curl \ - nginx \ - locales \ - php7.4-bcmath \ - php7.4-fpm \ - php7.4-gd \ - php7.4-json \ - php7.4-ldap \ - php7.4-mbstring \ - php7.4-xml \ - php7.4-pgsql \ - postgresql-client \ - supervisor && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + -o Dpkg::Options::="--force-confdef" \ + -o Dpkg::Options::="--force-confold" \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --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 /var/lib/php/session && \ rm -f /etc/nginx/conf.d/*.conf && \ rm -rf /var/cache/nginx/ && \ rm -f /etc/php/7.4/fpm/pool.d/www.conf && \ ln -sf /dev/fd/2 /var/log/nginx/error.log && \ rm -f /etc/php/7.4/fpm/php-fpm.conf.dpkg-dist && \ - DEBIAN_FRONTEND=noninteractive apt-get -y purge gpg dirmngr gpg-agent && \ cd /usr/share/zabbix/ && \ rm -f conf/zabbix.conf.php conf/maintenance.inc.php conf/zabbix.conf.php.example && \ rm -rf tests && \ @@ -95,8 +106,8 @@ RUN set -eux && \ 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' && \ + 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/ && \ @@ -107,6 +118,9 @@ RUN set -eux && \ chown --quiet -R zabbix:root /var/lib/php/session/ && \ chgrp -R 0 /var/lib/php/session/ && \ chmod -R g=u /var/lib/php/session/ && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + purge \ + ${INSTALL_TEMP_PKGS} && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfiles/web-service/alpine/Dockerfile b/Dockerfiles/web-service/alpine/Dockerfile index 75bda9525..8b610b53b 100644 --- a/Dockerfiles/web-service/alpine/Dockerfile +++ b/Dockerfiles/web-service/alpine/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,17 +9,20 @@ FROM alpine:3.14 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix web service" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web service for performing various tasks using headless web browser" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web service" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -28,8 +30,18 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_web_service", COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_web_service.conf", "/etc/zabbix/zabbix_web_service.conf"] RUN set -eux && \ - addgroup --system --gid 1995 zabbix && \ - adduser --system \ + INSTALL_PKGS="bash \ + chromium" && \ + apk add \ + --no-cache \ + --clean-protected \ + ${INSTALL_PKGS} && \ + addgroup \ + --system \ + --gid 1995 \ + zabbix && \ + adduser \ + --system \ --gecos "Zabbix monitoring system" \ --disabled-password \ --uid 1997 \ @@ -40,9 +52,6 @@ RUN set -eux && \ adduser zabbix root && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ - apk add --no-cache --clean-protected \ - bash \ - chromium && \ 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/ && \ diff --git a/Dockerfiles/web-service/alpine/hooks/build b/Dockerfiles/web-service/alpine/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/web-service/alpine/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/web-service/centos/Dockerfile b/Dockerfiles/web-service/centos/Dockerfile index cb39e4933..b9b20da29 100644 --- a/Dockerfiles/web-service/centos/Dockerfile +++ b/Dockerfiles/web-service/centos/Dockerfile @@ -2,25 +2,27 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder -FROM centos:8 +FROM centos:centos8 ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix web service" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web service for performing various tasks using headless web browser" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web service" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -28,10 +30,28 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/bin/zabbix_web_service", COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_web_service.conf", "/etc/zabbix/zabbix_web_service.conf"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + REPOLIST="baseos,appstream,epel" && \ + INSTALL_PKGS="bash \ + chromium \ + openssl-libs \ + zlib" && \ + dnf -y install epel-release && \ + dnf -y install \ + --disablerepo "*" \ + --enablerepo "${REPOLIST}" \ + --setopt=tsflags=nodocs \ + --setopt=install_weak_deps=False \ + --best \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -39,18 +59,6 @@ RUN set -eux && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ - REPOLIST="baseos,appstream,epel" && \ - INSTALL_PKGS="chromium \ - openssl-libs \ - zlib" && \ - dnf -y install epel-release && \ - dnf -y install \ - --disablerepo "*" \ - --enablerepo "${REPOLIST}" \ - --setopt=tsflags=nodocs \ - --setopt=install_weak_deps=False \ - --best \ - ${INSTALL_PKGS} && \ 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/ && \ diff --git a/Dockerfiles/web-service/centos/hooks/build b/Dockerfiles/web-service/centos/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/web-service/centos/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/web-service/ol/Dockerfile b/Dockerfiles/web-service/ol/Dockerfile index 92beeef0d..42f059540 100644 --- a/Dockerfiles/web-service/ol/Dockerfile +++ b/Dockerfiles/web-service/ol/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,17 +9,20 @@ FROM oraclelinux:8-slim ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix web service" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web service for performing various tasks using headless web browser" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web service" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -29,10 +31,28 @@ COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}/src/go/conf/zabbix_web_service. COPY ["conf/etc/yum.repos.d/oracle-epel-ol8.repo", "/etc/yum.repos.d/oracle-epel-ol8.repo"] RUN set -eux && \ - groupadd --system --gid 1995 zabbix && \ + INSTALL_PKGS="bash \ + chromium \ + openssl-libs \ + zlib" && \ + microdnf -y install \ + --disablerepo="*" \ + --enablerepo="ol8_baseos_latest" \ + --enablerepo="ol8_appstream" \ + --enablerepo="ol8_developer_EPEL" \ + --setopt=install_weak_deps=0 \ + --best \ + --nodocs \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ --uid 1997 \ --shell /sbin/nologin \ --home-dir /var/lib/zabbix/ \ @@ -40,17 +60,6 @@ RUN set -eux && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ - INSTALL_PKGS="chromium \ - openssl-libs \ - zlib" && \ - microdnf -y install \ - --disablerepo="*" \ - --enablerepo="ol8_baseos_latest" \ - --enablerepo="ol8_appstream" \ - --enablerepo="ol8_developer_EPEL" \ - --setopt=install_weak_deps=0 \ - --best \ - --nodocs ${INSTALL_PKGS} && \ 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/ && \ diff --git a/Dockerfiles/web-service/ol/hooks/build b/Dockerfiles/web-service/ol/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/web-service/ol/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/web-service/rhel/Dockerfile b/Dockerfiles/web-service/rhel/Dockerfile index 78d270d2c..eb67cdbd6 100644 --- a/Dockerfiles/web-service/rhel/Dockerfile +++ b/Dockerfiles/web-service/rhel/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 ARG MAJOR_VERSION=6.0 +ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -11,9 +11,10 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} LABEL name="zabbix/zabbix-web-service-trunk" \ maintainer="alexey.pustovalov@zabbix.com" \ @@ -78,6 +79,9 @@ RUN set -eux && \ mkdir -p /etc/zabbix && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/enc && \ + 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/ && \ microdnf -y clean all && \ rm -rf /var/cache/yum /var/lib/yum/yumdb/* /usr/lib/udev/hwdb.d/* && \ rm -rf /var/cache/dnf /etc/udev/hwdb.bin /root/.pki diff --git a/Dockerfiles/web-service/rhel/hooks/build b/Dockerfiles/web-service/rhel/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/web-service/rhel/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/web-service/ubuntu/Dockerfile b/Dockerfiles/web-service/ubuntu/Dockerfile index 957f38c67..361cfe625 100644 --- a/Dockerfiles/web-service/ubuntu/Dockerfile +++ b/Dockerfiles/web-service/ubuntu/Dockerfile @@ -2,7 +2,6 @@ ARG MAJOR_VERSION=6.0 ARG ZBX_VERSION=${MAJOR_VERSION} ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION} -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git FROM ${BUILD_BASE_IMAGE} as builder @@ -10,17 +9,20 @@ FROM ubuntu:focal ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -LABEL org.opencontainers.image.title="Zabbix web service" \ - org.opencontainers.image.authors="Alexey Pustovalov " \ - org.opencontainers.image.vendor="Zabbix LLC" \ - org.opencontainers.image.url="https://zabbix.com/" \ +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix web service for performing various tasks using headless web browser" \ - org.opencontainers.image.licenses="GPL v2.0" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.opencontainers.image.version="${ZBX_VERSION}" \ - org.opencontainers.image.source="${ZBX_SOURCES}" + org.opencontainers.image.licenses="GPL v2.0" \ + org.opencontainers.image.source="${ZBX_SOURCES}" \ + org.opencontainers.image.title="Zabbix web service" \ + org.opencontainers.image.url="https://zabbix.com/" \ + org.opencontainers.image.vendor="Zabbix LLC" \ + org.opencontainers.image.version="${ZBX_VERSION}" STOPSIGNAL SIGTERM @@ -30,21 +32,15 @@ COPY ["conf/etc/apt/preferences.d/chromium.pref", "/etc/apt/preferences.d/chromi RUN set -eux && \ echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \ - groupadd --system --gid 1995 zabbix && \ - useradd \ - --system --comment "Zabbix monitoring system" \ - -g zabbix -G root \ - --uid 1997 \ - --shell /sbin/nologin \ - --home-dir /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - apt-get -y update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + INSTALL_PKGS="bash \ ca-certificates \ - gnupg && \ + chromium \ + chromium-sandbox" && \ + INSTALL_TEMP_PKGS="gnupg" && \ + apt-get -y update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_TEMP_PKGS} && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DCC9EFBF77E11517 && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 && \ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50 && \ @@ -53,14 +49,31 @@ RUN set -eux && \ 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 && \ - DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ - chromium \ - chromium-sandbox && \ - DEBIAN_FRONTEND=noninteractive apt-get -y purge \ - gnupg && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + --no-install-recommends install \ + ${INSTALL_PKGS} && \ + groupadd \ + --system \ + --gid 1995 \ + zabbix && \ + useradd \ + --system \ + --comment "Zabbix monitoring system" \ + -g zabbix \ + -G root \ + --uid 1997 \ + --shell /sbin/nologin \ + --home-dir /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/enc && \ 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/ && \ + DEBIAN_FRONTEND=noninteractive apt-get -y \ + purge \ + ${INSTALL_TEMP_PKGS} && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* diff --git a/Dockerfiles/web-service/ubuntu/hooks/build b/Dockerfiles/web-service/ubuntu/hooks/build deleted file mode 100755 index 3e0a2f00c..000000000 --- a/Dockerfiles/web-service/ubuntu/hooks/build +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Additional information: https://docs.docker.com/docker-cloud/builds/advanced/ -# - -MAJOR_VERSION=$(cat Dockerfile | grep "ARG MAJOR_VERSION" | cut -f2 -d"=") -MINOR_VERSION=$(cat Dockerfile | grep "ARG ZBX_VERSION" | cut -f2 -d".") - -VCS_REF=$MAJOR_VERSION.$MINOR_VERSION -BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - -echo "$BUILD_DATE - Building $VCS_REF version..." -docker build --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$BUILD_DATE" -t $IMAGE_NAME . diff --git a/Dockerfiles/zabbix-appliance/rhel/Dockerfile b/Dockerfiles/zabbix-appliance/rhel/Dockerfile index b3264726a..162f45a65 100644 --- a/Dockerfiles/zabbix-appliance/rhel/Dockerfile +++ b/Dockerfiles/zabbix-appliance/rhel/Dockerfile @@ -1,12 +1,12 @@ FROM registry.access.redhat.com/ubi8/ubi -MAINTAINER Alexey Pustovalov ARG MAJOR_VERSION=6.0 ARG RELEASE= ARG ZBX_VERSION=${MAJOR_VERSION} - ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git -ENV TERM=xterm ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL LABEL name="zabbix/zabbix-appliance" \ diff --git a/build.sh b/build.sh index 6d1adb33d..ac91923da 100755 --- a/build.sh +++ b/build.sh @@ -37,7 +37,16 @@ else VCS_REF=$MAJOR_VERSION.$MINOR_VERSION fi -DOCKER_BUILDKIT=1 docker build -t zabbix-$app_component:$os-$version --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -f Dockerfile . +if hash docker 2>/dev/null; then + exec_command='docker' +elif hash podman 2>/dev/null; then + exec_command='podman' +else + echo >&2 "Build command requires docker or podman. Aborting."; + exit 1; +fi + +DOCKER_BUILDKIT=1 $exec_command build -t zabbix-$app_component:$os-$version --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` -f Dockerfile . if [ "$type" != "build" ]; then links="" @@ -47,15 +56,15 @@ if [ "$type" != "build" ]; then links="$links --link mysql-server:mysql" env_vars="$env_vars -e MYSQL_DATABASE=\"zabbix\" -e MYSQL_USER=\"zabbix\" -e MYSQL_PASSWORD=\"zabbix\" -e MYSQL_RANDOM_ROOT_PASSWORD=true" - docker rm -f mysql-server - docker run --name mysql-server -t $env_vars -d mysql:5.7 + $exec_command rm -f mysql-server + $exec_command run --name mysql-server -t $env_vars -d mysql:5.7 fi if [ "$links" != "" ]; then sleep 5 fi - docker rm -f zabbix-$app_component + $exec_command rm -f zabbix-$app_component - docker run --name zabbix-$app_component -t -d $links $env_vars zabbix-$app_component:$os-$version -fi \ No newline at end of file + $exec_command run --name zabbix-$app_component -t -d $links $env_vars zabbix-$app_component:$os-$version +fi