diff --git a/Dockerfiles/build-mysql/alpine/Dockerfile b/Dockerfiles/build-mysql/alpine/Dockerfile index 603d4b15a..f8e87d9c0 100644 --- a/Dockerfiles/build-mysql/alpine/Dockerfile +++ b/Dockerfiles/build-mysql/alpine/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -60,7 +61,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-mysql/centos/Dockerfile b/Dockerfiles/build-mysql/centos/Dockerfile index 18326971b..56888418b 100644 --- a/Dockerfiles/build-mysql/centos/Dockerfile +++ b/Dockerfiles/build-mysql/centos/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -54,7 +55,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-mysql/ol/Dockerfile b/Dockerfiles/build-mysql/ol/Dockerfile index d0c9a2233..5885a0942 100644 --- a/Dockerfiles/build-mysql/ol/Dockerfile +++ b/Dockerfiles/build-mysql/ol/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ @@ -41,7 +42,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-mysql/rhel/Dockerfile b/Dockerfiles/build-mysql/rhel/Dockerfile index 661ec106d..1106d01a9 100644 --- a/Dockerfiles/build-mysql/rhel/Dockerfile +++ b/Dockerfiles/build-mysql/rhel/Dockerfile @@ -35,6 +35,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -64,7 +65,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-mysql/ubuntu/Dockerfile b/Dockerfiles/build-mysql/ubuntu/Dockerfile index 559600c4c..ba981711f 100644 --- a/Dockerfiles/build-mysql/ubuntu/Dockerfile +++ b/Dockerfiles/build-mysql/ubuntu/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -60,7 +61,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-pgsql/alpine/Dockerfile b/Dockerfiles/build-pgsql/alpine/Dockerfile index 0288e1a5f..957c40959 100644 --- a/Dockerfiles/build-pgsql/alpine/Dockerfile +++ b/Dockerfiles/build-pgsql/alpine/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -60,7 +61,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-pgsql/centos/Dockerfile b/Dockerfiles/build-pgsql/centos/Dockerfile index ecb0293f1..70fd23a8b 100644 --- a/Dockerfiles/build-pgsql/centos/Dockerfile +++ b/Dockerfiles/build-pgsql/centos/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -54,7 +55,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-pgsql/ol/Dockerfile b/Dockerfiles/build-pgsql/ol/Dockerfile index 3ee237fcc..9ba8b8e12 100644 --- a/Dockerfiles/build-pgsql/ol/Dockerfile +++ b/Dockerfiles/build-pgsql/ol/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ @@ -41,7 +42,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-pgsql/ubuntu/Dockerfile b/Dockerfiles/build-pgsql/ubuntu/Dockerfile index e4c3bec69..bc48456e6 100644 --- a/Dockerfiles/build-pgsql/ubuntu/Dockerfile +++ b/Dockerfiles/build-pgsql/ubuntu/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -60,7 +61,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-sqlite3/alpine/Dockerfile b/Dockerfiles/build-sqlite3/alpine/Dockerfile index 715d35ff3..fbf2b0589 100644 --- a/Dockerfiles/build-sqlite3/alpine/Dockerfile +++ b/Dockerfiles/build-sqlite3/alpine/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -56,7 +57,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-sqlite3/centos/Dockerfile b/Dockerfiles/build-sqlite3/centos/Dockerfile index ba9c67950..62755e47f 100644 --- a/Dockerfiles/build-sqlite3/centos/Dockerfile +++ b/Dockerfiles/build-sqlite3/centos/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -50,7 +51,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-sqlite3/ol/Dockerfile b/Dockerfiles/build-sqlite3/ol/Dockerfile index 1ecc7dd2b..dbdae1c59 100644 --- a/Dockerfiles/build-sqlite3/ol/Dockerfile +++ b/Dockerfiles/build-sqlite3/ol/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ cd /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ @@ -37,7 +38,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-sqlite3/rhel/Dockerfile b/Dockerfiles/build-sqlite3/rhel/Dockerfile index bdf6c3d05..f5b51c31a 100644 --- a/Dockerfiles/build-sqlite3/rhel/Dockerfile +++ b/Dockerfiles/build-sqlite3/rhel/Dockerfile @@ -35,6 +35,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -60,7 +61,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \ diff --git a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile index 281423bbd..e4369d80e 100644 --- a/Dockerfiles/build-sqlite3/ubuntu/Dockerfile +++ b/Dockerfiles/build-sqlite3/ubuntu/Dockerfile @@ -25,6 +25,7 @@ ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_ RUN --mount=type=cache,target=/root/.cache/go-build/ \ --mount=type=cache,target=/root/go/ \ + --mount=type=bind,source=src/,target=/tmp/src \ set -eux && \ ARCH_SUFFIX="$(arch)"; \ case "$ARCH_SUFFIX" in \ @@ -56,7 +57,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \ - git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \ + if [ -f "/tmp/src/bootstrap.sh" ]; then \ + cp -R /tmp/src ${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 ${ZBX_SOURCES_DIR} && \ zabbix_revision=`git rev-parse --short HEAD` && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \