diff --git a/Dockerfiles/build-mysql/alpine/Dockerfile b/Dockerfiles/build-mysql/alpine/Dockerfile index 8cd75befba..d4f6eb6d5c 100644 --- a/Dockerfiles/build-mysql/alpine/Dockerfile +++ b/Dockerfiles/build-mysql/alpine/Dockerfile @@ -29,10 +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} +COPY src src + 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 [ -f src/bootstrap.sh ]; then mv 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 /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ @@ -51,7 +54,6 @@ 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} && \ cd ${ZBX_SOURCES_DIR} && \ patch -p1 < /tmp/chromedp_no_sandbox.patch && \ zabbix_revision=`git rev-parse --short HEAD` && \ diff --git a/Dockerfiles/build-mysql/centos/Dockerfile b/Dockerfiles/build-mysql/centos/Dockerfile index 5147f800db..1fce65a202 100644 --- a/Dockerfiles/build-mysql/centos/Dockerfile +++ b/Dockerfiles/build-mysql/centos/Dockerfile @@ -29,10 +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} +COPY src src + 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 [ -f src/bootstrap.sh ]; then mv 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 /tmp/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \ mkdir -p ${ZBX_OUTPUT_DIR}/agent/conf/ && \ @@ -51,7 +54,6 @@ 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} && \ cd ${ZBX_SOURCES_DIR} && \ patch -p1 < /tmp/chromedp_no_sandbox.patch && \ zabbix_revision=`git rev-parse --short HEAD` && \ diff --git a/Dockerfiles/build-mysql/ol/Dockerfile b/Dockerfiles/build-mysql/ol/Dockerfile index ece6abe7b9..b77ccf0917 100644 --- a/Dockerfiles/build-mysql/ol/Dockerfile +++ b/Dockerfiles/build-mysql/ol/Dockerfile @@ -10,6 +10,8 @@ ARG ZBX_VERSION ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git ARG GIT_BRANCH +ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION} + LABEL org.opencontainers.image.authors="Alexey Pustovalov " \ org.opencontainers.image.description="Zabbix build base for MySQL based images" \ org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \ @@ -22,15 +24,18 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov