tools/build-env/build.sh
author Kim Alvefur <zash@zash.se>
Tue, 12 Dec 2023 16:19:04 +0100
changeset 13407 0369f6986824
parent 13327 7bfd6db52528
permissions -rwxr-xr-x
tools: Fix selection of container engine Seems command -v in sh only checks and returns one argument, unlike bash.

#!/bin/sh -eux

cd "$(dirname "$0")"

containerify="$(command -v podman || command -v docker)"

if [ -z "$containerify" ]; then
	echo "podman or docker required" >&2
	exit 1
fi

$containerify build -f ./Containerfile --squash \
	--build-arg os="${2:-debian}" \
	--build-arg dist="${1:-testing}" \
	-t "prosody.im/build-env:${1:-testing}"