From 7958d297aa0bf67f77d367c896fe4f242b517030 Mon Sep 17 00:00:00 2001 From: Vladislavs Sokurenko Date: Wed, 7 Aug 2024 10:45:29 +0300 Subject: [PATCH] Added ability to specify local git directory in ZBX_SOURCES --- Dockerfiles/build-mysql/alpine/Dockerfile | 5 +++-- Dockerfiles/build-mysql/centos/Dockerfile | 5 +++-- Dockerfiles/build-mysql/ol/Dockerfile | 5 +++-- Dockerfiles/build-mysql/rhel/Dockerfile | 5 +++-- Dockerfiles/build-mysql/ubuntu/Dockerfile | 5 +++-- Dockerfiles/build-pgsql/alpine/Dockerfile | 5 +++-- Dockerfiles/build-pgsql/centos/Dockerfile | 5 +++-- Dockerfiles/build-pgsql/ol/Dockerfile | 5 +++-- Dockerfiles/build-pgsql/rhel/Dockerfile | 5 +++-- Dockerfiles/build-pgsql/ubuntu/Dockerfile | 5 +++-- Dockerfiles/build-sqlite3/alpine/Dockerfile | 5 +++-- Dockerfiles/build-sqlite3/centos/Dockerfile | 5 +++-- Dockerfiles/build-sqlite3/ol/Dockerfile | 5 +++-- Dockerfiles/build-sqlite3/rhel/Dockerfile | 5 +++-- Dockerfiles/build-sqlite3/ubuntu/Dockerfile | 5 +++-- 15 files changed, 45 insertions(+), 30 deletions(-) diff --git a/Dockerfiles/build-mysql/alpine/Dockerfile b/Dockerfiles/build-mysql/alpine/Dockerfile index 45c79e6c4e..14e79ed71c 100644 --- a/Dockerfiles/build-mysql/alpine/Dockerfile +++ b/Dockerfiles/build-mysql/alpine/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-mysql/centos/Dockerfile b/Dockerfiles/build-mysql/centos/Dockerfile index 0f43b77584..e9919f7778 100644 --- a/Dockerfiles/build-mysql/centos/Dockerfile +++ b/Dockerfiles/build-mysql/centos/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-mysql/ol/Dockerfile b/Dockerfiles/build-mysql/ol/Dockerfile index 3d38266e13..9560d512a3 100644 --- a/Dockerfiles/build-mysql/ol/Dockerfile +++ b/Dockerfiles/build-mysql/ol/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-mysql/rhel/Dockerfile b/Dockerfiles/build-mysql/rhel/Dockerfile index ded8c261e7..d9a7b623cb 100644 --- a/Dockerfiles/build-mysql/rhel/Dockerfile +++ b/Dockerfiles/build-mysql/rhel/Dockerfile @@ -9,7 +9,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -40,12 +40,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-mysql/ubuntu/Dockerfile b/Dockerfiles/build-mysql/ubuntu/Dockerfile index 506a8bf6c7..5b4e68d505 100644 --- a/Dockerfiles/build-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/build-mysql/ubuntu/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-pgsql/alpine/Dockerfile b/Dockerfiles/build-pgsql/alpine/Dockerfile index bec07e98e0..da9aa86836 100644 --- a/Dockerfiles/build-pgsql/alpine/Dockerfile +++ b/Dockerfiles/build-pgsql/alpine/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-pgsql/centos/Dockerfile b/Dockerfiles/build-pgsql/centos/Dockerfile index d4475f8bc1..7601d17262 100644 --- a/Dockerfiles/build-pgsql/centos/Dockerfile +++ b/Dockerfiles/build-pgsql/centos/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-pgsql/ol/Dockerfile b/Dockerfiles/build-pgsql/ol/Dockerfile index a51f890295..8608f28faf 100644 --- a/Dockerfiles/build-pgsql/ol/Dockerfile +++ b/Dockerfiles/build-pgsql/ol/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-pgsql/rhel/Dockerfile b/Dockerfiles/build-pgsql/rhel/Dockerfile index fe8eff83cb..09c68b55b9 100644 --- a/Dockerfiles/build-pgsql/rhel/Dockerfile +++ b/Dockerfiles/build-pgsql/rhel/Dockerfile @@ -9,7 +9,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -40,12 +40,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-pgsql/ubuntu/Dockerfile b/Dockerfiles/build-pgsql/ubuntu/Dockerfile index 5ddc96fb92..f1a44202ad 100644 --- a/Dockerfiles/build-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/build-pgsql/ubuntu/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,12 +29,13 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ --mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-sqlite3/alpine/Dockerfile b/Dockerfiles/build-sqlite3/alpine/Dockerfile index 877a9638e7..b6ee464fbd 100644 --- a/Dockerfiles/build-sqlite3/alpine/Dockerfile +++ b/Dockerfiles/build-sqlite3/alpine/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,11 +29,12 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-sqlite3/centos/Dockerfile b/Dockerfiles/build-sqlite3/centos/Dockerfile index 18dd57f476..6deae73d59 100644 --- a/Dockerfiles/build-sqlite3/centos/Dockerfile +++ b/Dockerfiles/build-sqlite3/centos/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,11 +29,12 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-sqlite3/ol/Dockerfile b/Dockerfiles/build-sqlite3/ol/Dockerfile index 9f65e9b5e4..f9fcbd9549 100644 --- a/Dockerfiles/build-sqlite3/ol/Dockerfile +++ b/Dockerfiles/build-sqlite3/ol/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,11 +29,12 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-sqlite3/rhel/Dockerfile b/Dockerfiles/build-sqlite3/rhel/Dockerfile index 390bf44f58..9c9df886fd 100644 --- a/Dockerfiles/build-sqlite3/rhel/Dockerfile +++ b/Dockerfiles/build-sqlite3/rhel/Dockerfile @@ -9,7 +9,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG RELEASE ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -40,11 +40,12 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ diff --git a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile index 40a53e29d0..a1b0123629 100644 --- a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile +++ b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder ARG MAJOR_VERSION ARG ZBX_VERSION -ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git#${GIT_BRANCH:-$ZBX_VERSION} +ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} @@ -29,11 +29,12 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \ EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} -ADD --keep-git-dir=true ${ZBX_SOURCES} ${ZBX_SOURCES_DIR} +COPY . . RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ set -eux && \ + if [ -d ${ZBX_SOURCES} ]; then mv ${ZBX_SOURCES} ${ZBX_SOURCES_DIR}; else git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR}; fi && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \