Skip to content

Commit 7bdafb9

Browse files
tcelylafin
authored andcommitted
update.sh: extract local tarball (multiarch#66)
Rules `ADD` follows: - If `<src>` is a URL and `<dest>` does not end with a trailing slash, then a file is downloaded from the URL and copied to `<dest>`. - If `<src>` is a URL and `<dest>` does end with a trailing slash, then the filename is inferred from the URL and the file is downloaded to `<dest>/<filename>`. For instance, `ADD http://example.com/foobar /` would create the file `/foobar`. The URL must have a nontrivial path so that an appropriate filename can be discovered in this case (http://example.com will not work).
1 parent bfb50d1 commit 7bdafb9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

update.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ to_archs="aarch64 aarch64_be alpha armeb arm cris hppa i386 m68k microblazeel mi
2828

2929
for to_arch in $to_archs; do
3030
if [ "$from_arch" != "$to_arch" ]; then
31-
docker build -t ${REPO}:$from_arch-$to_arch -<<EOF
31+
mkdir -p ${from_arch}_qemu-${to_arch}
32+
curl -sSL -o "${from_arch}_qemu-${to_arch}/${from_arch}_qemu-${to_arch}-static.tar.gz" \
33+
"https://github.com/${REPO}/releases/download/v${VERSION}/${from_arch}_qemu-${to_arch}-static.tar.gz"
34+
cat > ${from_arch}_qemu-${to_arch}/Dockerfile -<<EOF
3235
FROM scratch
33-
ADD https://github.com/${REPO}/releases/download/v${VERSION}/${from_arch}_qemu-${to_arch}-static.tar.gz /usr/bin
36+
ADD ${from_arch}_qemu-${to_arch}-static.tar.gz /usr/bin/
3437
EOF
38+
docker build -t ${REPO}:$from_arch-$to_arch ${from_arch}_qemu-${to_arch}
3539
docker tag ${REPO}:$from_arch-$to_arch ${REPO}:$to_arch
40+
rm -rf ${from_arch}_qemu-${to_arch}
3641
fi
3742
done
3843

0 commit comments

Comments
 (0)