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 <amulmek1@in.ibm.com>
This commit is contained in:
Amulyam24 2023-11-16 10:53:25 +05:30
parent 08f3603123
commit d8a8cc4491
2 changed files with 18 additions and 6 deletions

View File

@ -16,6 +16,9 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \
curl \ curl \
make \
git \
wget \
sudo && \ sudo && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \ apt-get clean && rm -rf /var/lib/apt/lists/ && \
install_yq.sh && \ install_yq.sh && \
@ -43,10 +46,7 @@ RUN apt-get update && \
build-essential \ build-essential \
cpio \ cpio \
gcc \ gcc \
git \
make \
unzip \ unzip \
wget \
xz-utils && \ xz-utils && \
apt-get clean && rm -rf /var/lib/apt/lists apt-get clean && rm -rf /var/lib/apt/lists

View File

@ -29,9 +29,21 @@ fi
arch=$(uname -m) arch=$(uname -m)
if [ "${arch}" = "ppc64le" ]; then if [ "${arch}" = "ppc64le" ]; then
echo "An ORAS release for ppc64le is not available yet." echo "Building oras from source"
exit 0 go_version="go1.21.3"
fi # 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 if [ "${arch}" = "x86_64" ]; then
arch="amd64" arch="amd64"
fi fi