forked from debezium/container-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-tool-images-multiplatform.sh
executable file
·39 lines (31 loc) · 1.17 KB
/
build-tool-images-multiplatform.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -eo pipefail
if [[ -z "$TAG" ]]; then
TAG="$1"
fi
if [ -z "${DEBEZIUM_TOOLS_PLATFORM}" ]; then
DEBEZIUM_TOOLS_PLATFORM=linux/amd64
fi;
if [ -z "${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}" ]; then
DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME=quay.io/debezium
fi;
if [ -z "${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}" ]; then
DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME=debezium
fi;
DEBEZIUM_TOOLS="tooling website-builder"
for TOOL in $DEBEZIUM_TOOLS; do
echo ""
echo "****************************************************************"
echo "** Building ${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}/$TOOL:$TAG for ${DEBEZIUM_TOOLS_PLATFORM}"
echo "****************************************************************"
unset TAGS
TAGS+=("-t ${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}/${TOOL}:$TAG")
if [ -n "${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}" ]; then
TAGS+=("-t ${DEBEZIUM_DOCKER_REGISTRY_SECONDARY_NAME}/${TOOL}:$TAG")
fi;
# shellcheck disable=SC2068
docker buildx build --push --platform "${DEBEZIUM_TOOLS_PLATFORM}" \
--build-arg DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME="${DEBEZIUM_DOCKER_REGISTRY_PRIMARY_NAME}" \
${TAGS[@]} \
"$TOOL"
done