mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-05-29 22:30:24 +02:00
Move sources directory and introduce additional build context
This commit is contained in:
parent
9161d3b1dd
commit
b0f7df6f69
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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
|
@ -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 \
|
||||
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 \
|
||||
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 \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
|
@ -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 \
|
||||
set -eux && \
|
||||
cd /tmp/ && \
|
||||
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
|
||||
|
2
build.sh
2
build.sh
@ -42,7 +42,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOCKER_BUILDKIT=1 $exec_command build -t "zabbix-$app_component:$os-$version" --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-arg VCS_REF="$VCS_REF" --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" -f Dockerfile .
|
||||
|
||||
if [ "$type" != "build" ]; then
|
||||
links=""
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-pgsql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-pgsql/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
@ -36,6 +40,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${ALPINE_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${ALPINE_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-pgsql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-pgsql/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${CENTOS_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${CENTOS_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-pgsql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-pgsql/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
@ -36,6 +40,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${OL_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${OL_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
|
@ -10,6 +10,8 @@ services:
|
||||
zabbix-build-pgsql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-pgsql/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
@ -22,6 +24,8 @@ services:
|
||||
zabbix-build-mysql:
|
||||
build:
|
||||
context: ./Dockerfiles/build-mysql/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
@ -36,6 +40,8 @@ services:
|
||||
zabbix-build-sqlite3:
|
||||
build:
|
||||
context: ./Dockerfiles/build-sqlite3/${UBUNTU_OS_TAG_SHORT}
|
||||
additional_contexts:
|
||||
- sources=./sources/
|
||||
cache_from:
|
||||
- "${UBUNTU_CACHE_FROM}"
|
||||
args:
|
||||
|
Loading…
x
Reference in New Issue
Block a user