Allow releases with podman or docker
@@ -13,12 +13,14 @@ source "${S2I_ROOT}/hack/common.sh"
source "${S2I_ROOT}/hack/util.sh"
s2i::log::install_errexit
+buildCmd=${S2I_BUILD_CMD:-"podman"}
+
# Go to the top of the tree.
cd "${S2I_ROOT}"
# Build the images
echo "++ Building openshift/sti-release"
-podman build -q --tag openshift/sti-release "${S2I_ROOT}/images/release"
+$buildCmd build -q --tag openshift/sti-release "${S2I_ROOT}/images/release"
context="${S2I_ROOT}/_output/buildenv-context"
@@ -40,9 +42,9 @@ git archive --format=tar -o "${context}/archive.tar" "${S2I_GIT_COMMIT}"
tar -rf "${context}/archive.tar" -C "${context}" sti-version-defs
gzip -f "${context}/archive.tar"
-# Perform the build and release in podman.
-cat "${context}/archive.tar.gz" | podman run -i --cidfile="${context}/cid" -e RELEASE_LDFLAGS="-w -s" openshift/sti-release
-podman cp $(cat ${context}/cid):/go/src/github.com/openshift/source-to-image/_output/local/releases "${S2I_OUTPUT}"
+# Perform the build and release in podman or docker.
+cat "${context}/archive.tar.gz" | $buildCmd run -i --cidfile="${context}/cid" -e RELEASE_LDFLAGS="-w -s" openshift/sti-release
+$buildCmd cp $(cat ${context}/cid):/go/src/github.com/openshift/source-to-image/_output/local/releases "${S2I_OUTPUT}"
echo "${S2I_GIT_COMMIT}" > "${S2I_LOCAL_RELEASEPATH}/.commit"
ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret"
