-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iremove multi-arch.bash but use skopeo to get images directly
Signed-off-by: Xiaodong Liu <liuxiaodong@loongson.cn>
- Loading branch information
1 parent
54c53b1
commit 9a9e527
Showing
10 changed files
with
79 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
TEST_IMAGES := debian busybox hello-world | ||
CONTAINER_ENGINE ?= docker | ||
|
||
download_images: | ||
$(foreach image, $(TEST_IMAGES),$(shell ./download_oci_image.sh "$(image)")) | ||
clean: | ||
-rm *.tar | ||
|
||
.PHONY: download_images clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
IMAGE="$1" | ||
GOARCH=$(go env GOARCH) | ||
# according to documents: https://github.com/docker-library/official-images#architectures-other-than-amd64 | ||
case ${GOARCH} in | ||
arm) | ||
skopeo copy -q docker://$(arch)/$IMAGE:latest "oci:$IMAGE:latest" | ||
;; | ||
|
||
*) | ||
skopeo copy -q docker://$GOARCH/$IMAGE:latest "oci:$IMAGE:latest" | ||
;; | ||
esac | ||
|
||
mkdir "$IMAGE"-tmp | ||
args="$([ $(id -u) != "0" ]&& echo -n "--rootless")" | ||
umoci unpack --image "$IMAGE" $args "$IMAGE"-tmp | ||
cd "$IMAGE"-tmp/rootfs | ||
tar -cf ../../"$IMAGE".tar . | ||
cd ../../ | ||
rm -rf "$IMAGE"-tmp | ||
|
||
# add tarball read permission | ||
chmod a+r "$IMAGE".tar |