From 32e02d831fe4d1ecc4be97e6d8471baa31cde51a Mon Sep 17 00:00:00 2001 From: root Date: Sat, 26 May 2018 03:58:52 -0700 Subject: [PATCH] Fixed CentOS images building --- agent/centos/Dockerfile | 117 ++++++++-------- agent/ubuntu/Dockerfile | 123 ++++++++--------- java-gateway/centos/Dockerfile | 104 +++++++------- proxy-mysql/centos/Dockerfile | 150 ++++++++++----------- proxy-sqlite3/centos/Dockerfile | 147 ++++++++++---------- server-mysql/centos/Dockerfile | 158 +++++++++++----------- server-pgsql/centos/Dockerfile | 161 +++++++++++----------- snmptraps/centos/Dockerfile | 78 +++++------ web-apache-mysql/centos/Dockerfile | 82 +++++------ web-apache-pgsql/centos/Dockerfile | 82 +++++------ web-nginx-mysql/centos/Dockerfile | 84 ++++++------ web-nginx-pgsql/centos/Dockerfile | 84 ++++++------ zabbix-appliance/centos/Dockerfile | 210 ++++++++++++++--------------- 13 files changed, 788 insertions(+), 792 deletions(-) diff --git a/agent/centos/Dockerfile b/agent/centos/Dockerfile index 553ce1276..acc8ea65f 100644 --- a/agent/centos/Dockerfile +++ b/agent/centos/Dockerfile @@ -1,53 +1,13 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm \ - ZBX_TYPE=agent ZBX_DB_TYPE=none ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-centos" \ - 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser -r --shell /sbin/nologin \ - -g zabbix \ - -d /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/zabbix_agentd.d && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/modules && \ - chown --quiet -R zabbix:root /var/lib/zabbix && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - libldap \ - openssl-libs && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE} --link zabbix-server:zabbix-server -p 10050:10050 -d zabbix-${ZBX_TYPE}:centos-${ZBX_VERSION}" +ENV TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} RUN yum --quiet makecache && \ yum ${YUM_FLAGS_DEV} install \ @@ -76,22 +36,61 @@ RUN yum --quiet makecache && \ --with-openssl \ --enable-ipv6 \ --silent && \ - make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_agent/zabbix_agentd /usr/sbin/zabbix_agentd && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + make -j"$(nproc)" -s 1>/dev/null + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_TYPE=agent ZBX_DB_TYPE=none ZBX_OPT_TYPE=none \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-centos" \ + 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.license="GPL v2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE} --link zabbix-server:zabbix-server -p 10050:10050 -d zabbix-${ZBX_TYPE}:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix \ + -d /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/zabbix_agentd.d && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/modules && \ + chown --quiet -R zabbix:root /var/lib/zabbix && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + libldap \ + openssl-libs && \ + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_agent/zabbix_agentd /usr/sbin/zabbix_agentd +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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 EXPOSE 10050/TCP diff --git a/agent/ubuntu/Dockerfile b/agent/ubuntu/Dockerfile index 499b04545..83ab76ba1 100644 --- a/agent/ubuntu/Dockerfile +++ b/agent/ubuntu/Dockerfile @@ -1,56 +1,15 @@ -FROM ubuntu:trusty -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM ubuntu:trusty as builder ARG APT_FLAGS_COMMON="-qq -y" -ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends" ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends" -ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm \ - ZBX_TYPE=agent ZBX_DB_TYPE=none ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-ubuntu" \ - 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN locale-gen $LC_ALL && \ - echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ - addgroup --system --quiet zabbix && \ - adduser --quiet \ - --system --disabled-login \ - --ingroup zabbix \ - --home /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix && \ - mkdir -p /etc/zabbix/zabbix_agentd.d && \ - mkdir -p /var/lib/zabbix && \ - mkdir -p /var/lib/zabbix/enc && \ - mkdir -p /var/lib/zabbix/modules && \ - chown --quiet -R zabbix:root /var/lib/zabbix && \ - apt-get ${APT_FLAGS_COMMON} update && \ - apt-get ${APT_FLAGS_COMMON} autoremove && \ - apt-get ${APT_FLAGS_COMMON} clean && \ - rm -rf /var/lib/apt/lists/* - ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE} --link zabbix-server:zabbix-server -p 10050:10050 -d zabbix-${ZBX_TYPE}:ubuntu-${ZBX_VERSION}" - -RUN apt-get ${APT_FLAGS_COMMON} update && \ +RUN locale-gen $LC_ALL && \ + apt-get ${APT_FLAGS_COMMON} update && \ apt-get ${APT_FLAGS_DEV} install \ autoconf \ automake \ @@ -78,27 +37,61 @@ RUN apt-get ${APT_FLAGS_COMMON} update && \ --with-openssl \ --enable-ipv6 \ --silent && \ - make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_agent/zabbix_agentd /usr/sbin/zabbix_agentd && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - apt-get ${APT_FLAGS_COMMON} purge \ - autoconf \ - automake \ - libc6-dev \ - libssl-dev \ - make \ - pkg-config \ - subversion \ - gcc 1>/dev/null && \ + make -j"$(nproc)" -s 1>/dev/null + +FROM ubuntu:trusty +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG APT_FLAGS_COMMON="-qq -y" +ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm \ + ZBX_TYPE=agent ZBX_DB_TYPE=none ZBX_OPT_TYPE=none \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-ubuntu" \ + 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.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE} --link zabbix-server:zabbix-server -p 10050:10050 -d zabbix-${ZBX_TYPE}:ubuntu-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN locale-gen $LC_ALL && \ + echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ + addgroup --system --quiet zabbix && \ + adduser --quiet \ + --system --disabled-login \ + --ingroup zabbix \ + --home /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix && \ + mkdir -p /etc/zabbix/zabbix_agentd.d && \ + mkdir -p /var/lib/zabbix && \ + mkdir -p /var/lib/zabbix/enc && \ + mkdir -p /var/lib/zabbix/modules && \ + chown --quiet -R zabbix:root /var/lib/zabbix && \ + apt-get ${APT_FLAGS_COMMON} update && \ apt-get ${APT_FLAGS_COMMON} autoremove && \ apt-get ${APT_FLAGS_COMMON} clean && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /root/.subversion + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_agent/zabbix_agentd /usr/sbin/zabbix_agentd +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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 EXPOSE 10050/TCP diff --git a/java-gateway/centos/Dockerfile b/java-gateway/centos/Dockerfile index 0939fbc3d..dcda4703d 100644 --- a/java-gateway/centos/Dockerfile +++ b/java-gateway/centos/Dockerfile @@ -1,48 +1,14 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm \ - ZBX_TYPE=java-gateway ZBX_DB_TYPE=none ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-centos" \ - 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser --system --shell /sbin/nologin \ - -g zabbix \ - -d /var/lib/zabbix/ \ - zabbix && \ - mkdir -p /etc/zabbix/ && \ - chown --quiet -R zabbix:root /etc/zabbix && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - java-1.8.0-openjdk-headless && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ - + ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE} --link zabbix-server:zabbix-server -p 10052:10052 -d zabbix-${ZBX_TYPE}:centos-${ZBX_VERSION}" +ENV TERM=xterm \ + ZBX_TYPE=java-gateway ZBX_DB_TYPE=none ZBX_OPT_TYPE=none \ + ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} RUN yum --quiet makecache && \ yum ${YUM_FLAGS_DEV} install \ @@ -67,20 +33,54 @@ RUN yum --quiet makecache && \ --enable-java \ --silent && \ make -j"$(nproc)" -s 1>/dev/null && \ + rm -rf src/zabbix_java/lib/*.xml + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} +ENV TERM=xterm \ + ZBX_TYPE=java-gateway ZBX_DB_TYPE=none ZBX_OPT_TYPE=none + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-centos" \ + 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.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE} --link zabbix-server:zabbix-server -p 10052:10052 -d zabbix-${ZBX_TYPE}:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN groupadd --system zabbix && \ + adduser --system --shell /sbin/nologin \ + -g zabbix \ + -d /var/lib/zabbix/ \ + zabbix && \ + mkdir -p /etc/zabbix/ && \ + chown --quiet -R zabbix:root /etc/zabbix && \ mkdir -p /usr/sbin/zabbix_java/ && \ - cp -r src/zabbix_java/bin /usr/sbin/zabbix_java/ && \ - cp -r src/zabbix_java/lib /usr/sbin/zabbix_java/ && \ - rm -rf /usr/sbin/zabbix_java/lib/*.xml && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + java-1.8.0-openjdk-headless && \ + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum/ + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/bin/* /usr/sbin/zabbix_java/bin/ +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib/* /usr/sbin/zabbix_java/lib/ EXPOSE 10052/TCP diff --git a/proxy-mysql/centos/Dockerfile b/proxy-mysql/centos/Dockerfile index 26c0f488d..dfb722170 100644 --- a/proxy-mysql/centos/Dockerfile +++ b/proxy-mysql/centos/Dockerfile @@ -1,69 +1,13 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ - ZBX_TYPE=proxy ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix ${ZBX_TYPE} 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser -r --shell /sbin/nologin \ - -g zabbix \ - -d /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 && \ - chown --quiet -R zabbix:root /var/lib/zabbix && \ - mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - fping \ - libcurl \ - libxml2 \ - mariadb \ - net-snmp-libs \ - OpenIPMI-libs \ - openldap \ - openssl-libs \ - pcre \ - unixODBC && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 10051:10051 -d zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZBX_TYPE=proxy ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=none RUN yum --quiet makecache && \ yum ${YUM_FLAGS_DEV} install \ @@ -107,24 +51,78 @@ RUN yum --quiet makecache && \ --silent && \ make -j"$(nproc)" -s dbschema 1>/dev/null && \ make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ cat database/${ZBX_DB_TYPE}/schema.sql > database/${ZBX_DB_TYPE}/create.sql && \ - gzip database/${ZBX_DB_TYPE}/create.sql && \ - cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + gzip database/${ZBX_DB_TYPE}/create.sql + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ + ZBX_TYPE=proxy ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=none + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix ${ZBX_TYPE} 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.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 10051:10051 -d zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix \ + -d /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 && \ + chown --quiet -R zabbix:root /var/lib/zabbix && \ + mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + fping \ + libcurl \ + libxml2 \ + mariadb \ + net-snmp-libs \ + OpenIPMI-libs \ + openldap \ + openssl-libs \ + pcre \ + unixODBC && \ + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum/ + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz EXPOSE 10051/TCP diff --git a/proxy-sqlite3/centos/Dockerfile b/proxy-sqlite3/centos/Dockerfile index 8e2c3a9df..808a3f6c4 100644 --- a/proxy-sqlite3/centos/Dockerfile +++ b/proxy-sqlite3/centos/Dockerfile @@ -1,68 +1,13 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ - ZBX_TYPE=proxy ZBX_DB_TYPE=sqlite3 ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix ${ZBX_TYPE} 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser -r --shell /sbin/nologin \ - -g zabbix \ - -d /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 && \ - chown --quiet -R zabbix:root /var/lib/zabbix && \ - mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - fping \ - libcurl \ - libxml2 \ - net-snmp-libs \ - OpenIPMI-libs \ - openldap \ - openssl-libs \ - pcre \ - unixODBC && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} --link zabbix-server:zabbix-server -p 10051:10051 -d zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZBX_TYPE=proxy ZBX_DB_TYPE=sqlite3 ZBX_OPT_TYPE=none RUN yum --quiet makecache && \ yum ${YUM_FLAGS_DEV} install \ @@ -106,21 +51,77 @@ RUN yum --quiet makecache && \ --silent && \ make -j"$(nproc)" -s dbschema 1>/dev/null && \ make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + cat database/${ZBX_DB_TYPE}/schema.sql > database/${ZBX_DB_TYPE}/create.sql && \ + gzip database/${ZBX_DB_TYPE}/create.sql + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ + ZBX_TYPE=proxy ZBX_DB_TYPE=sqlite3 ZBX_OPT_TYPE=none + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix ${ZBX_TYPE} 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.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} --link zabbix-server:zabbix-server -p 10051:10051 -d zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix \ + -d /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 && \ + chown --quiet -R zabbix:root /var/lib/zabbix && \ + mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + fping \ + libcurl \ + libxml2 \ + net-snmp-libs \ + OpenIPMI-libs \ + openldap \ + openssl-libs \ + pcre \ + unixODBC && \ + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum/ + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz EXPOSE 10051/TCP diff --git a/server-mysql/centos/Dockerfile b/server-mysql/centos/Dockerfile index 84da92709..8d4b8d615 100644 --- a/server-mysql/centos/Dockerfile +++ b/server-mysql/centos/Dockerfile @@ -1,75 +1,16 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ARG DB_TYPE=mysql -ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ - ZBX_TYPE=server ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix ${ZBX_TYPE} 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser -r --shell /sbin/nologin \ - -g zabbix -G dialout \ - -d /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 /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 /var/lib/zabbix && \ - mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_DEV} install epel-release && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - fping \ - iksemel \ - libcurl \ - libxml2 \ - mariadb \ - net-snmp-libs \ - OpenIPMI-libs \ - openldap \ - openssl-libs \ - pcre \ - unixODBC && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql -p 10051:10051 -d zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZBX_TYPE=server ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=none RUN yum --quiet makecache && \ + yum ${YUM_FLAGS_DEV} install epel-release && \ yum ${YUM_FLAGS_DEV} install \ autoconf \ automake \ @@ -113,26 +54,83 @@ RUN yum --quiet makecache && \ --silent && \ make -j"$(nproc)" -s dbschema 1>/dev/null && \ make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ cat database/${ZBX_DB_TYPE}/schema.sql > database/${ZBX_DB_TYPE}/create.sql && \ cat database/${ZBX_DB_TYPE}/images.sql >> database/${ZBX_DB_TYPE}/create.sql && \ cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \ - gzip database/${ZBX_DB_TYPE}/create.sql && \ - cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + gzip database/${ZBX_DB_TYPE}/create.sql + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ + ZBX_TYPE=server ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=none + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix ${ZBX_TYPE} 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.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql -p 10051:10051 -d zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix -G dialout \ + -d /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 /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 /var/lib/zabbix && \ + mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + fping \ + iksemel \ + libcurl \ + libxml2 \ + mariadb \ + net-snmp-libs \ + OpenIPMI-libs \ + openldap \ + openssl-libs \ + pcre \ + unixODBC && \ + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum/ + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz EXPOSE 10051/TCP diff --git a/server-pgsql/centos/Dockerfile b/server-pgsql/centos/Dockerfile index 3624983e0..02595af89 100644 --- a/server-pgsql/centos/Dockerfile +++ b/server-pgsql/centos/Dockerfile @@ -1,76 +1,16 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm -ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ - ZBX_TYPE=server ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=none - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix ${ZBX_TYPE} with PostgreSQL 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.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser -r --shell /sbin/nologin \ - -g zabbix -G dialout \ - -d /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 /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 /var/lib/zabbix && \ - mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_DEV} install epel-release && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - fping \ - iksemel \ - libcurl \ - libxml2 \ - net-snmp-libs \ - OpenIPMI-libs \ - openldap \ - openssl-libs \ - pcre \ - postgresql \ - postgresql-libs \ - unixODBC && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-pgsql --link postgres-server:postgres -p 10051:10051 -d zabbix-${ZBX_TYPE}-pgsql:centos-${ZBX_VERSION}" +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZBX_TYPE=server ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=none RUN yum --quiet makecache && \ + yum ${YUM_FLAGS_DEV} install epel-release && \ yum ${YUM_FLAGS_DEV} install \ autoconf \ automake \ @@ -114,26 +54,85 @@ RUN yum --quiet makecache && \ --silent && \ make -j"$(nproc)" -s dbschema 1>/dev/null && \ make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ cat database/${ZBX_DB_TYPE}/schema.sql > database/${ZBX_DB_TYPE}/create.sql && \ cat database/${ZBX_DB_TYPE}/images.sql >> database/${ZBX_DB_TYPE}/create.sql && \ cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \ - gzip database/${ZBX_DB_TYPE}/create.sql && \ - cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + gzip database/${ZBX_DB_TYPE}/create.sql + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ + ZBX_TYPE=server ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=none + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix ${ZBX_TYPE} with PostgreSQL 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.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-${ZBX_TYPE}-pgsql --link postgres-server:postgres -p 10051:10051 -d zabbix-${ZBX_TYPE}-pgsql:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix -G dialout \ + -d /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 /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 /var/lib/zabbix && \ + mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE} && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + fping \ + iksemel \ + libcurl \ + libxml2 \ + net-snmp-libs \ + OpenIPMI-libs \ + openldap \ + openssl-libs \ + pcre \ + postgresql \ + postgresql-libs \ + unixODBC && \ + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum/ + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz EXPOSE 10051/TCP diff --git a/snmptraps/centos/Dockerfile b/snmptraps/centos/Dockerfile index b6fe68ef1..08bc13945 100644 --- a/snmptraps/centos/Dockerfile +++ b/snmptraps/centos/Dockerfile @@ -1,3 +1,30 @@ +FROM centos:centos7 as builder + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} + +COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] + +RUN yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_DEV} install \ + autoconf \ + automake \ + gcc \ + patch \ + make \ + libnsl-devel \ + net-snmp-devel && \ + cd /tmp/ && \ + tar -zxf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ + cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ + patch -p1 < ./patches/makefile.patch && \ + make -j"$(nproc)" -s 1>/dev/null + FROM centos:centos7 LABEL maintainer "Alexey Pustovalov " @@ -6,8 +33,11 @@ ARG VCS_REF ARG YUM_FLAGS_COMMON="--quiet -y" ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" -ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL LABEL org.label-schema.name="zabbix-snmptraps-centos" \ org.label-schema.vendor="Zabbix LLC" \ @@ -16,21 +46,17 @@ LABEL org.label-schema.name="zabbix-snmptraps-centos" \ org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.schema-version="1.0" \ - org.label-schema.license="GPL 2.0" - -ARG MAJOR_VERSION=master -ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.license="GPL 2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ org.label-schema.version="1.14" \ org.label-schema.vcs-url="https://anonscm.debian.org/gitweb/?p=collab-maint/snmptrapfmt.git" \ org.label-schema.docker.cmd="docker run --name zabbix-snmptraps --link zabbix-server:zabbix-server -p 162:162/UDP -d zabbix-snmptraps:centos-${ZBX_VERSION}" STOPSIGNAL SIGTERM -COPY ["snmptrapfmt_1.14+nmu1ubuntu2.tar.gz", "/tmp/"] +COPY --from=builder /tmp/snmptrapfmt-1.14+nmu1ubuntu1/snmptrapfmthdlr /usr/sbin/snmptrapfmthdlr +COPY --from=builder /tmp/snmptrapfmt-1.14+nmu1ubuntu1/snmptrapfmt /usr/sbin/snmptrapfmt +COPY --from=builder /tmp/snmptrapfmt-1.14+nmu1ubuntu1/snmptrapfmt.conf /etc/snmp/snmptrapfmt.conf RUN groupadd --system zabbix && \ adduser -r --shell /sbin/nologin \ @@ -38,31 +64,14 @@ RUN groupadd --system zabbix && \ -d /var/lib/zabbix/ \ zabbix && \ yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_DEV} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install epel-release && \ yum ${YUM_FLAGS_PERSISTANT} install \ net-snmp \ supervisor && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - autoconf \ - automake \ - gcc \ - patch \ - make \ - libnsl-devel \ - net-snmp-devel && \ mkdir -p /var/lib/zabbix && \ mkdir -p /var/lib/zabbix/snmptraps && \ mkdir -p /var/lib/zabbix/mibs && \ chown --quiet -R zabbix:root /var/lib/zabbix && \ - cd /tmp/ && \ - tar -zxf snmptrapfmt_1.14+nmu1ubuntu2.tar.gz && \ - ls -lah && \ - cd /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ && \ - patch -p1 < ./patches/makefile.patch && \ - make -j"$(nproc)" -s 1>/dev/null && \ - cp snmptrapfmthdlr /usr/sbin/snmptrapfmthdlr && \ - cp snmptrapfmt /usr/sbin/snmptrapfmt && \ - cp snmptrapfmt.conf /etc/snmp/snmptrapfmt.conf && \ echo "disableAuthorization yes" >> "/etc/snmp/snmptrapd.conf" && \ echo "traphandle default /usr/sbin/snmptrapfmthdlr" >> "/etc/snmp/snmptrapd.conf" && \ sed -i \ @@ -70,17 +79,8 @@ RUN groupadd --system zabbix && \ -e '/^LOGFMT=/s/=.*/=\"$x ZBXTRAP $R $G $S $e $*\"/' \ -e "/^LOGFILE=/s/=.*/=\"\/var\/lib\/zabbix\/snmptraps\/snmptraps.log\"/" \ "/etc/snmp/snmptrapfmt.conf" && \ - rm -rf /tmp/snmptrapfmt_1.14+nmu1ubuntu2.tar.gz 1>/dev/null && \ - rm -rf /tmp/snmptrapfmt-1.14+nmu1ubuntu1/ 1>/dev/null && \ - yum history && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + rm -rf /var/cache/yum EXPOSE 162/UDP diff --git a/web-apache-mysql/centos/Dockerfile b/web-apache-mysql/centos/Dockerfile index 3545d2bae..916a97d36 100644 --- a/web-apache-mysql/centos/Dockerfile +++ b/web-apache-mysql/centos/Dockerfile @@ -1,3 +1,32 @@ +FROM centos:centos7 as builder + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ + ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=apache + +COPY ["conf/tmp/font-config", "/tmp/font-config"] + +RUN yum --quiet makecache && \ + yum ${YUM_FLAGS_DEV} install \ + gettext \ + patch \ + subversion && \ + cd /tmp/ && \ + svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ + cd /tmp/zabbix/ && \ + patch -p3 < /tmp/font-config && \ + rm /tmp/font-config && \ + rm -f conf/zabbix.conf.php && \ + rm -rf tests && \ + rm /tmp/zabbix/fonts/DejaVuSans.ttf && \ + ./locale/make_mo.sh 2>/dev/null + FROM centos:centos7 LABEL maintainer="Alexey Pustovalov " @@ -6,8 +35,11 @@ ARG VCS_REF ARG YUM_FLAGS_COMMON="--quiet -y" ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" -ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm \ +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=apache LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ @@ -17,10 +49,16 @@ LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.schema-version="1.0" \ - org.label-schema.license="GPL 2.0" + org.label-schema.license="GPL v2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" STOPSIGNAL SIGTERM +COPY --from=builder /tmp/zabbix/ /usr/share/zabbix/ + RUN groupadd --system zabbix && \ adduser -r --shell /sbin/nologin \ -g zabbix \ @@ -41,46 +79,10 @@ RUN groupadd --system zabbix && \ php-mbstring \ php-mysql \ php-xml && \ + ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ yum ${YUM_FLAGS_PERSISTANT} clean all && \ rm -rf /var/cache/yum/ -ARG MAJOR_VERSION=master -ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" - -COPY ["conf/tmp/font-config", "/tmp/font-config"] - -RUN yum --quiet makecache && \ - yum ${YUM_FLAGS_DEV} install \ - gettext \ - patch \ - subversion && \ - cd /usr/share/ && \ - svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ - cd /usr/share/zabbix/ && \ - patch -p3 < /tmp/font-config && \ - rm /tmp/font-config && \ - rm -f conf/zabbix.conf.php && \ - rm -rf tests && \ - rm /usr/share/zabbix/fonts/DejaVuSans.ttf && \ - ./locale/make_mo.sh 2>/dev/null && \ - ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ - chown -R apache:apache /usr/share/zabbix && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion - EXPOSE 80/TCP 443/TCP WORKDIR /usr/share/zabbix diff --git a/web-apache-pgsql/centos/Dockerfile b/web-apache-pgsql/centos/Dockerfile index f45addfe4..137b4741d 100644 --- a/web-apache-pgsql/centos/Dockerfile +++ b/web-apache-pgsql/centos/Dockerfile @@ -1,3 +1,32 @@ +FROM centos:centos7 as builder + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ + ZBX_TYPE=frontend ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=apache + +COPY ["conf/tmp/font-config", "/tmp/font-config"] + +RUN yum --quiet makecache && \ + yum ${YUM_FLAGS_DEV} install \ + gettext \ + patch \ + subversion && \ + cd /tmp/ && \ + svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ + cd /tmp/zabbix/ && \ + patch -p3 < /tmp/font-config && \ + rm /tmp/font-config && \ + rm -f conf/zabbix.conf.php && \ + rm -rf tests && \ + rm /tmp/zabbix/fonts/DejaVuSans.ttf && \ + ./locale/make_mo.sh 2>/dev/null + FROM centos:centos7 LABEL maintainer="Alexey Pustovalov " @@ -6,8 +35,11 @@ ARG VCS_REF ARG YUM_FLAGS_COMMON="--quiet -y" ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" -ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm \ +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ ZBX_TYPE=frontend ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=apache LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ @@ -17,10 +49,16 @@ LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.schema-version="1.0" \ - org.label-schema.license="GPL v2.0" + org.label-schema.license="GPL v2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-pgsql --link postgres-server:postgres --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-pgsql:centos-${ZBX_VERSION}" STOPSIGNAL SIGTERM +COPY --from=builder /tmp/zabbix/ /usr/share/zabbix/ + RUN groupadd --system zabbix && \ adduser -r --shell /sbin/nologin \ -g zabbix \ @@ -42,46 +80,10 @@ RUN groupadd --system zabbix && \ php-pgsql \ php-xml \ postgresql && \ + ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ yum ${YUM_FLAGS_PERSISTANT} clean all && \ rm -rf /var/cache/yum/ -ARG MAJOR_VERSION=master -ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-pgsql --link postgres-server:postgres --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-pgsql:centos-${ZBX_VERSION}" - -COPY ["conf/tmp/font-config", "/tmp/font-config"] - -RUN yum --quiet makecache && \ - yum ${YUM_FLAGS_DEV} install \ - gettext \ - patch \ - subversion && \ - cd /usr/share/ && \ - svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ - cd /usr/share/zabbix/ && \ - patch -p3 < /tmp/font-config && \ - rm /tmp/font-config && \ - rm -f conf/zabbix.conf.php && \ - rm -rf tests && \ - rm /usr/share/zabbix/fonts/DejaVuSans.ttf && \ - ./locale/make_mo.sh 2>/dev/null && \ - chown -R apache:apache /usr/share/zabbix && \ - ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion - EXPOSE 80/TCP 443/TCP WORKDIR /usr/share/zabbix diff --git a/web-nginx-mysql/centos/Dockerfile b/web-nginx-mysql/centos/Dockerfile index 2dcd7314c..988c8f11b 100644 --- a/web-nginx-mysql/centos/Dockerfile +++ b/web-nginx-mysql/centos/Dockerfile @@ -1,3 +1,32 @@ +FROM centos:centos7 as builder + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ + ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx + +COPY ["conf/tmp/font-config", "/tmp/font-config"] + +RUN yum --quiet makecache && \ + yum ${YUM_FLAGS_DEV} install \ + gettext \ + patch \ + subversion && \ + cd /tmp/ && \ + svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ + cd /tmp/zabbix/ && \ + patch -p3 < /tmp/font-config && \ + rm /tmp/font-config && \ + rm -f conf/zabbix.conf.php && \ + rm -rf tests && \ + rm /tmp/zabbix/fonts/DejaVuSans.ttf && \ + ./locale/make_mo.sh 2>/dev/null + FROM centos:centos7 LABEL maintainer="Alexey Pustovalov " @@ -6,8 +35,11 @@ ARG VCS_REF ARG YUM_FLAGS_COMMON="--quiet -y" ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" -ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm \ +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ @@ -17,10 +49,16 @@ LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.schema-version="1.0" \ - org.label-schema.license="GPL 2.0" + org.label-schema.license="GPL v2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" STOPSIGNAL SIGTERM +COPY --from=builder /tmp/zabbix/ /usr/share/zabbix/ + RUN groupadd --system zabbix && \ adduser -r --shell /sbin/nologin \ -g zabbix \ @@ -30,7 +68,7 @@ RUN groupadd --system zabbix && \ mkdir -p /etc/zabbix/web && \ chown --quiet -R zabbix:root /etc/zabbix && \ yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_DEV} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install epel-release && \ yum ${YUM_FLAGS_PERSISTANT} install \ dejavu-sans-fonts \ mariadb \ @@ -43,49 +81,13 @@ RUN groupadd --system zabbix && \ php-mysql \ php-xml \ supervisor && \ + ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ rm -f /etc/php-fpm.d/www.conf && \ mkdir -p /var/lib/php/ && \ chown --quiet -R nginx:nginx /var/lib/php/ && \ yum ${YUM_FLAGS_PERSISTANT} clean all && \ rm -rf /var/cache/yum/ -ARG MAJOR_VERSION=master -ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}" - -COPY ["conf/tmp/font-config", "/tmp/font-config"] - -RUN yum --quiet makecache && \ - yum ${YUM_FLAGS_DEV} install \ - gettext \ - patch \ - subversion && \ - cd /usr/share/ && \ - svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ - cd /usr/share/zabbix/ && \ - patch -p3 < /tmp/font-config && \ - rm /tmp/font-config && \ - rm -f conf/zabbix.conf.php && \ - rm -rf tests && \ - rm /usr/share/zabbix/fonts/DejaVuSans.ttf && \ - ./locale/make_mo.sh 2>/dev/null && \ - chown -R nginx:nginx /usr/share/zabbix && \ - ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion - EXPOSE 80/TCP 443/TCP WORKDIR /usr/share/zabbix diff --git a/web-nginx-pgsql/centos/Dockerfile b/web-nginx-pgsql/centos/Dockerfile index 00be52664..1e8a7c8b2 100644 --- a/web-nginx-pgsql/centos/Dockerfile +++ b/web-nginx-pgsql/centos/Dockerfile @@ -1,3 +1,32 @@ +FROM centos:centos7 as builder + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" + +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ + ZBX_TYPE=frontend ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=nginx + +COPY ["conf/tmp/font-config", "/tmp/font-config"] + +RUN yum --quiet makecache && \ + yum ${YUM_FLAGS_DEV} install \ + gettext \ + patch \ + subversion && \ + cd /tmp/ && \ + svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ + cd /tmp/zabbix/ && \ + patch -p3 < /tmp/font-config && \ + rm /tmp/font-config && \ + rm -f conf/zabbix.conf.php && \ + rm -rf tests && \ + rm /tmp/zabbix/fonts/DejaVuSans.ttf && \ + ./locale/make_mo.sh 2>/dev/null + FROM centos:centos7 LABEL maintainer="Alexey Pustovalov " @@ -6,8 +35,11 @@ ARG VCS_REF ARG YUM_FLAGS_COMMON="--quiet -y" ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" -ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm \ +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm \ ZBX_TYPE=frontend ZBX_DB_TYPE=postgresql ZBX_OPT_TYPE=nginx LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ @@ -17,10 +49,16 @@ LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \ org.label-schema.vcs-ref="${VCS_REF}" \ org.label-schema.build-date="${BUILD_DATE}" \ org.label-schema.schema-version="1.0" \ - org.label-schema.license="GPL 2.0" + org.label-schema.license="GPL v2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-pgsql --link postgres-server:postgres --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-pgsql:centos-${ZBX_VERSION}" STOPSIGNAL SIGTERM +COPY --from=builder /tmp/zabbix/ /usr/share/zabbix/ + RUN groupadd --system zabbix && \ adduser -r --shell /sbin/nologin \ -g zabbix \ @@ -30,7 +68,7 @@ RUN groupadd --system zabbix && \ mkdir -p /etc/zabbix/web && \ chown --quiet -R zabbix:root /etc/zabbix && \ yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_DEV} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install epel-release && \ yum ${YUM_FLAGS_PERSISTANT} install supervisor \ dejavu-sans-fonts \ nginx \ @@ -42,49 +80,13 @@ RUN groupadd --system zabbix && \ php-mbstring \ php-pgsql \ php-xml && \ + ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ rm -f /etc/php-fpm.d/www.conf && \ mkdir -p /var/lib/php/ && \ chown --quiet -R nginx:nginx /var/lib/php/ && \ yum ${YUM_FLAGS_PERSISTANT} clean all && \ rm -rf /var/cache/yum/ -ARG MAJOR_VERSION=master -ARG ZBX_VERSION=${MAJOR_VERSION} -ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-pgsql --link postgres-server:postgres --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-pgsql:centos-${ZBX_VERSION}" - -COPY ["conf/tmp/font-config", "/tmp/font-config"] - -RUN yum --quiet makecache && \ - yum ${YUM_FLAGS_DEV} install \ - gettext \ - patch \ - subversion && \ - cd /usr/share/ && \ - svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ - cd /usr/share/zabbix/ && \ - patch -p3 < /tmp/font-config && \ - rm /tmp/font-config && \ - rm -f conf/zabbix.conf.php && \ - rm -rf tests && \ - rm /usr/share/zabbix/fonts/DejaVuSans.ttf && \ - ./locale/make_mo.sh 2>/dev/null && \ - chown -R nginx:nginx /usr/share/zabbix && \ - ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion - EXPOSE 80/TCP 443/TCP WORKDIR /usr/share/zabbix diff --git a/zabbix-appliance/centos/Dockerfile b/zabbix-appliance/centos/Dockerfile index afd391dec..1b6c2ab0c 100644 --- a/zabbix-appliance/centos/Dockerfile +++ b/zabbix-appliance/centos/Dockerfile @@ -1,92 +1,19 @@ -FROM centos:centos7 -LABEL maintainer="Alexey Pustovalov " - -ARG BUILD_DATE -ARG VCS_REF +FROM centos:centos7 as builder ARG YUM_FLAGS_COMMON="--quiet -y" -ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}" -ENV TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ - ZBX_TYPE=server ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx \ - MYSQL_ALLOW_EMPTY_PASSWORD=true ZBX_ADD_SERVER=true ZBX_ADD_WEB=true DB_SERVER_HOST=localhost MYSQL_USER=zabbix ZBX_ADD_JAVA_GATEWAY=true ZBX_JAVAGATEWAY_ENABLE=true ZBX_JAVAGATEWAY=localhost - -LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ - org.label-schema.vendor="Zabbix LLC" \ - org.label-schema.url="https://zabbix.com/" \ - org.label-schema.description="Zabbix appliance with MySQL database support and ${ZBX_OPT_TYPE} web-server" \ - org.label-schema.vcs-ref="${VCS_REF}" \ - org.label-schema.build-date="${BUILD_DATE}" \ - org.label-schema.schema-version="1.0" \ - org.label-schema.license="GPL 2.0" - -STOPSIGNAL SIGTERM - -RUN groupadd --system zabbix && \ - adduser -r --shell /sbin/nologin \ - -g zabbix -G dialout \ - -d /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 /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 /var/lib/zabbix && \ - mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \ - yum ${YUM_FLAGS_COMMON} makecache && \ - yum ${YUM_FLAGS_DEV} install epel-release && \ - yum ${YUM_FLAGS_PERSISTANT} install \ - OpenIPMI-libs \ - dejavu-sans-fonts \ - fping \ - iksemel \ - java-1.8.0-openjdk-headless \ - libcurl \ - libxml2 \ - mariadb \ - mariadb-server \ - net-snmp-libs \ - nginx \ - openldap \ - openssl-libs \ - pcre \ - php-bcmath \ - php-fpm \ - php-gd \ - php-ldap \ - php-mbstring \ - php-mysql \ - php-xml \ - supervisor \ - unixODBC && \ - rm -f /etc/php-fpm.d/www.conf && \ - mkdir -p /var/lib/php/ && \ - chown --quiet -R nginx:nginx /var/lib/php/ && \ - yum ${YUM_FLAGS_PERSISTANT} clean all && \ - rm -rf /var/cache/yum/ ARG MAJOR_VERSION=master ARG ZBX_VERSION=${MAJOR_VERSION} ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ -ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} - -LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ - org.label-schema.version="${ZBX_VERSION}" \ - org.label-schema.vcs-url="${ZBX_SOURCES}" \ - org.label-schema.docker.cmd="docker run --name zabbix-appliance -p 80:80 -p 10051:10051 -d zabbix-appliance:centos-${ZBX_VERSION}" +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + ZBX_TYPE=server ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx \ + MYSQL_ALLOW_EMPTY_PASSWORD=true ZBX_ADD_SERVER=true ZBX_ADD_WEB=true DB_SERVER_HOST=localhost MYSQL_USER=zabbix ZBX_ADD_JAVA_GATEWAY=true ZBX_JAVAGATEWAY_ENABLE=true ZBX_JAVAGATEWAY=localhost COPY ["conf/tmp/font-config", "/tmp/font-config"] -RUN yum --quiet makecache && \ +RUN yum ${YUM_FLAGS_DEV} install epel-release && \ + yum --quiet makecache && \ yum ${YUM_FLAGS_DEV} install \ autoconf \ automake \ @@ -136,40 +63,113 @@ RUN yum --quiet makecache && \ --silent && \ make -j"$(nproc)" -s dbschema 1>/dev/null && \ make -j"$(nproc)" -s 1>/dev/null && \ - cp src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} && \ - cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \ - cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \ - cp conf/zabbix_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf && \ - chown --quiet -R zabbix:root /etc/zabbix && \ cat database/${ZBX_DB_TYPE}/schema.sql > database/${ZBX_DB_TYPE}/create.sql && \ cat database/${ZBX_DB_TYPE}/images.sql >> database/${ZBX_DB_TYPE}/create.sql && \ cat database/${ZBX_DB_TYPE}/data.sql >> database/${ZBX_DB_TYPE}/create.sql && \ gzip database/${ZBX_DB_TYPE}/create.sql && \ - cp database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \ - mkdir -p /usr/sbin/zabbix_java/ && \ - cp -r src/zabbix_java/bin /usr/sbin/zabbix_java/ && \ - cp -r src/zabbix_java/lib /usr/sbin/zabbix_java/ && \ - rm -rf /usr/sbin/zabbix_java/lib/*.xml && \ - cd /tmp/ && \ - rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \ - cd /usr/share/ && \ - svn --quiet export ${ZBX_SOURCES}/frontends/php/ zabbix 1>/dev/null && \ - cd /usr/share/zabbix/ && \ + rm -rf /tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib/*.xml && \ + cd frontends/php/ && \ patch -p3 < /tmp/font-config && \ - rm /tmp/font-config && \ rm -f conf/zabbix.conf.php && \ rm -rf tests && \ - rm /usr/share/zabbix/fonts/DejaVuSans.ttf && \ - ./locale/make_mo.sh 2>/dev/null && \ + rm /tmp/zabbix-${ZBX_VERSION}/frontends/php/fonts/DejaVuSans.ttf && \ + ./locale/make_mo.sh 2>/dev/null + +FROM centos:centos7 +LABEL maintainer="Alexey Pustovalov " + +ARG BUILD_DATE +ARG VCS_REF + +ARG YUM_FLAGS_COMMON="--quiet -y" +ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}" +ARG MAJOR_VERSION=master +ARG ZBX_VERSION=${MAJOR_VERSION} +ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/ +ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \ + TERM=xterm MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL \ + ZBX_TYPE=server ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx \ + MYSQL_ALLOW_EMPTY_PASSWORD=true ZBX_ADD_SERVER=true ZBX_ADD_WEB=true DB_SERVER_HOST=localhost MYSQL_USER=zabbix ZBX_ADD_JAVA_GATEWAY=true ZBX_JAVAGATEWAY_ENABLE=true ZBX_JAVAGATEWAY=localhost + +LABEL org.label-schema.name="zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}-centos" \ + org.label-schema.vendor="Zabbix LLC" \ + org.label-schema.url="https://zabbix.com/" \ + org.label-schema.description="Zabbix appliance with MySQL database support and ${ZBX_OPT_TYPE} web-server" \ + org.label-schema.vcs-ref="${VCS_REF}" \ + org.label-schema.build-date="${BUILD_DATE}" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.license="GPL v2.0" \ + org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ + org.label-schema.version="${ZBX_VERSION}" \ + org.label-schema.vcs-url="${ZBX_SOURCES}" \ + org.label-schema.docker.cmd="docker run --name zabbix-appliance -p 80:80 -p 10051:10051 -d zabbix-appliance:centos-${ZBX_VERSION}" + +STOPSIGNAL SIGTERM + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_${ZBX_TYPE}/zabbix_${ZBX_TYPE} /usr/sbin/zabbix_${ZBX_TYPE} +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_get/zabbix_get /usr/bin/zabbix_get +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_${ZBX_TYPE}.conf /etc/zabbix/zabbix_${ZBX_TYPE}.conf +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/database/${ZBX_DB_TYPE}/create.sql.gz /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/create.sql.gz + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/bin/ /usr/sbin/zabbix_java/bin/ +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/src/zabbix_java/lib/ /usr/sbin/zabbix_java/lib/ + +COPY --from=builder /tmp/zabbix-${ZBX_VERSION}/frontends/php/ /usr/share/zabbix/ + +RUN groupadd --system zabbix && \ + adduser -r --shell /sbin/nologin \ + -g zabbix -G dialout \ + -d /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 /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 /var/lib/zabbix && \ + mkdir -p /usr/share/doc/zabbix-${ZBX_TYPE}-${ZBX_DB_TYPE}/ && \ + yum ${YUM_FLAGS_COMMON} makecache && \ + yum ${YUM_FLAGS_PERSISTANT} install epel-release && \ + yum ${YUM_FLAGS_PERSISTANT} install \ + OpenIPMI-libs \ + dejavu-sans-fonts \ + fping \ + iksemel \ + java-1.8.0-openjdk-headless \ + libcurl \ + libxml2 \ + mariadb \ + mariadb-server \ + net-snmp-libs \ + nginx \ + openldap \ + openssl-libs \ + pcre \ + php-bcmath \ + php-fpm \ + php-gd \ + php-ldap \ + php-mbstring \ + php-mysql \ + php-xml \ + supervisor \ + unixODBC && \ + rm -f /etc/php-fpm.d/www.conf && \ + mkdir -p /var/lib/php/ && \ + chown --quiet -R nginx:nginx /var/lib/php/ && \ + ls -lah /usr/share/zabbix/ && \ ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/zabbix/fonts/graphfont.ttf && \ - yum ${YUM_FLAGS_COMMON} history undo `yum history | sed -n 4p |column -t | cut -d' ' -f1` 1>/dev/null && \ - yum ${YUM_FLAGS_COMMON} clean all && \ - rm -rf /var/cache/yum && \ - rm -rf /var/lib/yum/yumdb/* && \ - rm -rf /usr/lib/udev/hwdb.d/* && \ - rm -rf /etc/udev/hwdb.bin && \ - rm -rf /root/.pki && \ - rm -rf /root/.subversion + yum ${YUM_FLAGS_PERSISTANT} clean all && \ + rm -rf /var/cache/yum/ EXPOSE 80/TCP 443/TCP 10051/TCP