build: allow choice of container runtime

This commit is contained in:
Tom van Dijk 2025-05-15 16:55:42 +02:00
parent 435a9cad03
commit 6a5231e962
No known key found for this signature in database
GPG Key ID: 7A984C8207ADBA51

View File

@ -22,18 +22,20 @@ cleanup () {
trap cleanup EXIT
declare oci_cmd
declare OCI_CMD
if whereis podman >/dev/null; then
oci_cmd=podman
elif whereis docker >/dev/null; then
oci_cmd=docker
else
if [ "x${OCI_CMD:-}" = "x" ]; then
if whereis docker >/dev/null; then
OCI_CMD=docker
elif whereis podman >/dev/null; then
OCI_CMD=podman
else
echo "No container engine (docker/podman) found!"
exit 2
fi
fi
"$oci_cmd" build -t isle "$SRCDIR/docker"
"$OCI_CMD" build -t isle "$SRCDIR/docker"
mkdir -p result
rm -rf result/*
@ -42,7 +44,7 @@ if [[ "x${JOBS:-}" == "x" ]]; then
JOBS=$(nproc)
fi
"$oci_cmd" run -it \
"$OCI_CMD" run -it \
-e CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo" \
-v "$SRCDIR":/isle:rw \
-e JOBS="$JOBS" \