File tree Expand file tree Collapse file tree 4 files changed +35
-7
lines changed
Expand file tree Collapse file tree 4 files changed +35
-7
lines changed Original file line number Diff line number Diff line change 4949# Handle case where the script directory is not the working directory
5050script_dir=$( cd $( dirname $0 ) || exit 1; pwd)
5151source " ${script_dir} /dockcross-manylinux-set-vars.sh"
52+ source " ${script_dir} /oci_exe.sh"
53+
54+ oci_exe=$( ociExe)
5255
5356if [[ -n ${ITK_MODULE_PREQ} ]]; then
5457 echo " Building module dependencies ${ITK_MODULE_PREQ} "
@@ -81,14 +84,14 @@ if [[ "${TARGET_ARCH}" = "aarch64" ]]; then
8184 docker_prefix=" sudo"
8285 fi
8386
84- ${docker_prefix} docker run --privileged --rm tonistiigi/binfmt --install all
87+ ${docker_prefix} $oci_exe run --privileged --rm tonistiigi/binfmt --install all
8588
8689 # Build wheels
8790 DOCKER_ARGS+=" -v $( pwd) :/work/ --rm"
88- ${docker_prefix} docker run $DOCKER_ARGS ${CONTAINER_SOURCE} " /ITKPythonPackage/scripts/internal/manylinux-aarch64-build-module-wheels.sh" " $@ "
91+ ${docker_prefix} $oci_exe run $DOCKER_ARGS ${CONTAINER_SOURCE} " /ITKPythonPackage/scripts/internal/manylinux-aarch64-build-module-wheels.sh" " $@ "
8992else
9093 # Generate dockcross scripts
91- docker run --rm ${CONTAINER_SOURCE} > /tmp/dockcross-manylinux-x64
94+ $oci_exe run --rm ${CONTAINER_SOURCE} > /tmp/dockcross-manylinux-x64
9295 chmod u+x /tmp/dockcross-manylinux-x64
9396
9497 # Build wheels
Original file line number Diff line number Diff line change 1717# export IMAGE_TAG=20221205-459c9f0
1818# scripts/dockcross-manylinux-build-module-wheels.sh cp39
1919#
20+ script_dir=$( cd $( dirname $0 ) || exit 1; pwd)
21+ source " ${script_dir} /oci_exe.sh"
22+
23+ oci_exe=$( ociExe)
2024
2125MANYLINUX_VERSION=${MANYLINUX_VERSION:= _2_28}
2226
3034fi
3135
3236# Generate dockcross scripts
33- docker run --rm dockcross/manylinux${MANYLINUX_VERSION} -x64:${IMAGE_TAG} > /tmp/dockcross-manylinux-x64
37+ $oci_exe run --rm docker.io/ dockcross/manylinux${MANYLINUX_VERSION} -x64:${IMAGE_TAG} > /tmp/dockcross-manylinux-x64
3438chmod u+x /tmp/dockcross-manylinux-x64
3539
36- script_dir=$( cd $( dirname $0 ) || exit 1; pwd)
37-
3840# Build wheels
3941pushd $script_dir /..
4042mkdir -p dist
Original file line number Diff line number Diff line change 5252# Set container for requested version/arch/tag.
5353if [[ ${TARGET_ARCH} == x64 ]]; then
5454 MANYLINUX_IMAGE_NAME=${MANYLINUX_IMAGE_NAME:= " manylinux${MANYLINUX_VERSION} -${TARGET_ARCH} :${IMAGE_TAG} " }
55- CONTAINER_SOURCE=" dockcross/${MANYLINUX_IMAGE_NAME} "
55+ CONTAINER_SOURCE=" docker.io/ dockcross/${MANYLINUX_IMAGE_NAME} "
5656elif [[ ${TARGET_ARCH} == aarch64 ]]; then
5757 MANYLINUX_IMAGE_NAME=${MANYLINUX_IMAGE_NAME:= " manylinux${MANYLINUX_VERSION} _${TARGET_ARCH} :${IMAGE_TAG} " }
5858 CONTAINER_SOURCE=" quay.io/pypa/${MANYLINUX_IMAGE_NAME} "
Original file line number Diff line number Diff line change 1+ function ociExe() {
2+ # Check for OCI_EXE environmental variable
3+ if [[ -n " $OCI_EXE " && -x " $OCI_EXE " ]]; then
4+ echo " $OCI_EXE "
5+ return
6+ fi
7+
8+ # Check for podman executable
9+ if which podman > /dev/null 2>&1 ; then
10+ echo " podman"
11+ return
12+ fi
13+
14+ # Check for docker executable
15+ if which docker > /dev/null 2>&1 ; then
16+ echo " docker"
17+ return
18+ fi
19+
20+ # If none of the above exist, return nothing
21+ echo " Could not find podman or docker executable" >&2
22+ exit 1
23+ }
You can’t perform that action at this time.
0 commit comments