-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·50 lines (41 loc) · 1.19 KB
/
build.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
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# For "weird" multiplatform failures:
#
# docker run --pull always --rm --privileged multiarch/qemu-user-static --reset -p yes
docker_user="icemarkom"
image_prefix="pdns"
build_targets=("dnsdist" "server" "recursor")
platform_list="linux/amd64,linux/arm64,linux/arm"
# Default target versions
dnsdist="1.6.1"
server="4.5.2"
recursor="4.5.7"
if [[ ! -z "${PLATFORM_LIST}" ]]; then
platform_list="${PLATFORM_LIST}"
fi
# TODO([email protected]): These could potentially be moved into the build loop...
# dnsdist version override
if [[ ! -z "${DNSDIST_VERSION}" ]]; then
dnsdist="${DNSDIST_VERSION}"
fi
# server version override
if [[ ! -z "${PDNS_SERVER_VERSION}" ]]; then
server="${PDNS_SERVER_VERSION}"
fi
# recursor version override
if [[ ! -z "${PDNS_RECURSOR_VERSION}" ]]; then
recursor="${PDNS_RECURSOR_VERSION}"
fi
if [[ ! -z $1 ]]; then
build_targets=($*)
fi
for build_target in ${build_targets[@]}; do
target_version="${!build_target}"
docker buildx build \
--target="${build_target}" \
--build-arg "${build_target}_version"="${target_version}" \
-t "${docker_user}/${image_prefix}-${build_target}" \
--platform="${platform_list}" \
--push \
${PWD}
done