Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

build cni for more than just amd64 #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,26 @@ FLANNEL_CNI_ROOT=$(git rev-parse --show-toplevel)
IMAGE_NAME=quay.io/coreos/flannel-cni
VERSION=$($FLANNEL_CNI_ROOT/scripts/git-version)
CNI_VERSION="v0.6.0"
ARCH=$(uname -m)

case $ARCH in
aarch64)
ARCHITECTURE=arm64
VERSION_ARCH=$VERSION-$ARCHITECTURE
;;
x86_64)
ARCHITECTURE=amd64
VERSION_ARCH=$VERSION
;;
*)
ARCHITECTURE=$ARCH
VERSION_ARCH=$VERSION-$ARCHITECTURE
;;
esac

mkdir -p dist
$CURL -L --retry 5 https://github.com/containernetworking/cni/releases/download/$CNI_VERSION/cni-amd64-$CNI_VERSION.tgz | tar -xz -C dist/
$CURL -L --retry 5 https://github.com/containernetworking/plugins/releases/download/$CNI_VERSION/cni-plugins-amd64-$CNI_VERSION.tgz | tar -xz -C dist/
$CURL -L --retry 5 https://github.com/containernetworking/cni/releases/download/$CNI_VERSION/cni-$ARCHITECTURE-$CNI_VERSION.tgz | tar -xz -C dist/
$CURL -L --retry 5 https://github.com/containernetworking/plugins/releases/download/$CNI_VERSION/cni-plugins-$ARCHITECTURE-$CNI_VERSION.tgz | tar -xz -C dist/

docker build --no-cache -t $IMAGE_NAME:$VERSION .
docker push $IMAGE_NAME:$VERSION
docker build --no-cache -t $IMAGE_NAME:$VERSION_ARCH .
docker push $IMAGE_NAME:$VERSION_ARCH