Add a multi-arch fat-manifest creating tool 37/4937/1
authortrevor tao <trevor.tao@arm.com>
Fri, 1 Jul 2022 15:16:20 +0000 (23:16 +0800)
committertrevor tao <trevor.tao@arm.com>
Fri, 1 Jul 2022 15:16:20 +0000 (23:16 +0800)
Signed-off-by: trevor tao <trevor.tao@arm.com>
Change-Id: Iacf104a15780935035093da26cee54d8d69070bb

src/tools/create_march_images.sh [new file with mode: 0755]

diff --git a/src/tools/create_march_images.sh b/src/tools/create_march_images.sh
new file mode 100755 (executable)
index 0000000..da713b5
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+set -eux
+
+registry=${1:-iecedge/sriov-cni:ba420ed48a87033a91c9f825d3581f60046a2ae8}
+ARCHES="${ARCHES:-amd64 arm64}"
+IFS=" " read -r -a __arches__ <<< "$ARCHES"
+
+images=()
+for arch in "${__arches__[@]}"; do
+    image="${registry}-${arch}"
+    #kind build node-image --image="${image}" --arch="${arch}" "${kdir}"
+    images+=("${image}")
+done
+
+export DOCKER_CLI_EXPERIMENTAL=enabled
+
+# images must be pushed to be referenced by docker manifest
+# we push only after all builds have succeeded
+#for image in "${images[@]}"; do
+#    docker push "${image}"
+#done
+
+docker manifest rm "${registry}" || true
+docker manifest create "${registry}" "${images[@]}"
+docker manifest push "${registry}"