From 277a2db6744e8e9e5708bd30ebe7b3ae6043f287 Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Mon, 3 Nov 2025 17:43:29 -0700 Subject: [PATCH] include missing installer script Signed-off-by: Travis Glenn Hansen --- docker/ctr-installer.sh | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 docker/ctr-installer.sh diff --git a/docker/ctr-installer.sh b/docker/ctr-installer.sh new file mode 100755 index 0000000..45c8898 --- /dev/null +++ b/docker/ctr-installer.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e +set -x + +PLATFORM_TYPE=${1} + +if [[ "${PLATFORM_TYPE}" == "build" ]]; then + PLATFORM=$BUILDPLATFORM +else + PLATFORM=$TARGETPLATFORM +fi + +if [[ "x${PLATFORM}" == "x" ]]; then + PLATFORM="linux/amd64" +fi + +# these come from the --platform option of buildx, indirectly from DOCKER_BUILD_PLATFORM in main.yaml +# linux/amd64,linux/arm64,linux/arm/v7,linux/s390x,linux/ppc64le +if [ "$PLATFORM" = "linux/amd64" ]; then + export PLATFORM_ARCH="amd64" +elif [ "$PLATFORM" = "linux/arm64" ]; then + export PLATFORM_ARCH="arm64" +elif [ "$PLATFORM" = "linux/arm/v7" ]; then + export PLATFORM_ARCH="arm" +elif [ "$PLATFORM" = "linux/s390x" ]; then + export PLATFORM_ARCH="s390x" +elif [ "$PLATFORM" = "linux/ppc64le" ]; then + export PLATFORM_ARCH="ppc64le" +else + echo "unsupported/unknown ctr PLATFORM ${PLATFORM}" + exit 0 +fi + +echo "I am installing ctr $CTR_VERSION" + +export CTR_FILE="ctr-${CTR_VERSION}-linux-arm64" +wget -O "${CTR_FILE}" "https://github.com/democratic-csi/democratic-csi/releases/download/v1.0.0/${CTR_FILE}" + +mv ${CTR_FILE} /usr/local/bin/ctr +chown root:root /usr/local/bin/ctr +chmod +x /usr/local/bin/ctr