From d8a8cc4491416ca866f20ce538c35cc380ecbe1b Mon Sep 17 00:00:00 2001 From: Amulyam24 Date: Thu, 16 Nov 2023 10:53:25 +0530 Subject: [PATCH] tools: install oras from source on ppc64le Since the release is not yet out for ppc64le, build oras from source and use it. Fixes: #8458 Signed-off-by: Amulyam24 --- .../local-build/dockerbuild/Dockerfile | 6 +++--- .../local-build/dockerbuild/install_oras.sh | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile b/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile index a29514968b2e..cef937b6d657 100644 --- a/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile +++ b/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile @@ -16,6 +16,9 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates \ curl \ + make \ + git \ + wget \ sudo && \ apt-get clean && rm -rf /var/lib/apt/lists/ && \ install_yq.sh && \ @@ -43,10 +46,7 @@ RUN apt-get update && \ build-essential \ cpio \ gcc \ - git \ - make \ unzip \ - wget \ xz-utils && \ apt-get clean && rm -rf /var/lib/apt/lists diff --git a/tools/packaging/kata-deploy/local-build/dockerbuild/install_oras.sh b/tools/packaging/kata-deploy/local-build/dockerbuild/install_oras.sh index 973a10205075..7d12ec188b74 100755 --- a/tools/packaging/kata-deploy/local-build/dockerbuild/install_oras.sh +++ b/tools/packaging/kata-deploy/local-build/dockerbuild/install_oras.sh @@ -29,9 +29,21 @@ fi arch=$(uname -m) if [ "${arch}" = "ppc64le" ]; then - echo "An ORAS release for ppc64le is not available yet." - exit 0 -fi + echo "Building oras from source" + go_version="go1.21.3" + # Install go + wget https://go.dev/dl/${go_version}.linux-ppc64le.tar.gz + rm -rf /usr/local/go && tar -C /usr/local -xzf ${go_version}.linux-ppc64le.tar.gz + export PATH=$PATH:/usr/local/go/bin + go version + + git clone https://github.com/oras-project/oras.git + pushd oras + make build-linux-ppc64le + cp bin/linux/ppc64le/oras ${install_dest} + popd + exit 0 + fi if [ "${arch}" = "x86_64" ]; then arch="amd64" fi