mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-01-03 04:09:31 +01:00
Move sources directory and introduce additional build context
This commit is contained in:
parent
4840ebfe80
commit
4a9c6eb3c6
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ zbx_env*/
|
||||
.*KEY_FILE
|
||||
.*CA_FILE
|
||||
Dockerfiles/*/rhel/secrets/*
|
||||
sources/*
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -45,7 +45,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -45,9 +45,14 @@ 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/ \
|
||||
<<<<<<< HEAD
|
||||
--mount=type=bind,source=src/,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
=======
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
>>>>>>> b0f7df6f6 (Move sources directory and introduce additional build context)
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -45,7 +45,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
@ -34,7 +34,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 \
|
||||
--mount=from=sources,target=/tmp/src \
|
||||
--mount=type=bind,source=patches/,target=/tmp/patches \
|
||||
--mount=from=config_templates,target=/tmp/conf \
|
||||
set -eux && \
|
||||
|
7
build.sh
7
build.sh
@ -42,7 +42,12 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOCKER_BUILDKIT=1 $exec_command build -t "zabbix-$app_component:$os-$version" --build-context config_templates="../../../config_templates" --build-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" -f Dockerfile .
|
||||
DOCKER_BUILDKIT=1 $exec_command build -t "zabbix-$app_component:$os-$version" \
|
||||
--build-context sources="../../../sources" \
|
||||
--build-context config_templates="../../../config_templates" \
|
||||
--build-arg VCS_REF="$VCS_REF" \
|
||||
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
|
||||
-f Dockerfile .
|
||||
|
||||
if [ "$type" != "build" ]; then
|
||||
links=""
|
||||
|
@ -14,6 +14,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
@ -28,6 +29,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -12,6 +12,7 @@ services:
|
||||
context: ./Dockerfiles/build-pgsql/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
@ -26,6 +27,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
@ -42,6 +44,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -14,6 +14,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
@ -28,6 +29,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -12,6 +12,7 @@ services:
|
||||
context: ./Dockerfiles/build-pgsql/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
@ -26,6 +27,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -12,6 +12,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
@ -26,6 +27,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -12,6 +12,7 @@ services:
|
||||
context: ./Dockerfiles/build-pgsql/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
@ -26,6 +27,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
@ -42,6 +44,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -12,6 +12,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
@ -26,6 +27,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -12,6 +12,7 @@ services:
|
||||
context: ./Dockerfiles/build-pgsql/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
@ -26,6 +27,7 @@ services:
|
||||
context: ./Dockerfiles/build-mysql/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
@ -42,6 +44,7 @@ services:
|
||||
context: ./Dockerfiles/build-sqlite3/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- config_templates=./config_templates/
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
|
Loading…
Reference in New Issue
Block a user