2022-03-04 22:55:57 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
source ${ABSDIR}/../functions.sh
|
|
|
|
source ${ABSDIR}/vars.sh
|
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
2022-03-05 09:30:15 +00:00
|
|
|
buildfolder=/tmp/synapse-$$
|
|
|
|
|
2022-05-25 19:22:15 +00:00
|
|
|
if ! podman image exists ${synapse_image}:${synapse_version}; then
|
2022-03-05 09:30:15 +00:00
|
|
|
mkdir ${buildfolder} &&
|
2022-03-05 09:48:02 +00:00
|
|
|
curl -sSfL -- "https://github.com/matrix-org/synapse/archive/refs/tags/${synapse_version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ && {
|
2022-03-04 22:55:57 +00:00
|
|
|
podman run -d --name buildkitd --privileged docker.io/moby/buildkit:latest &&
|
2022-03-05 22:34:52 +00:00
|
|
|
my_buildctl --addr=podman-container://buildkitd build \
|
2022-03-05 08:40:20 +00:00
|
|
|
--frontend dockerfile.v0 \
|
2022-03-05 09:30:15 +00:00
|
|
|
--local context=${buildfolder}/ \
|
|
|
|
--local dockerfile=${buildfolder}/docker/ \
|
2022-05-23 17:29:44 +00:00
|
|
|
--output type=oci,name="${synapse_image}:${synapse_version}" | \
|
2022-03-05 11:53:20 +00:00
|
|
|
podman load &&
|
2022-03-04 22:55:57 +00:00
|
|
|
podman rm --force buildkitd &&
|
2022-03-05 22:43:34 +00:00
|
|
|
podman rmi docker.io/moby/buildkit:latest
|
2022-03-04 22:55:57 +00:00
|
|
|
}
|
2022-03-05 09:30:15 +00:00
|
|
|
rm -rf ${buildfolder}
|
2022-03-04 22:55:57 +00:00
|
|
|
fi
|