Skip to content

Commit 4b5e1ef

Browse files
committed
Add builder-scripts/target-arch-alternative
Get the alternative name for the TARGETARCH for downloading pre-built programs that use the alternative name. Adding in preparation for downloading NCBI BLAST that uses `x86_64` and `aarch64`. Unclear to me if there's a better way of doing this, but it works!
1 parent 3a0111d commit 4b5e1ef

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
#
3+
# Get the alternative target arch name from a Docker target arch.
4+
#
5+
# The Docker target arch is provided by the TARGETARCH variable¹.
6+
# ¹ https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
7+
#
8+
set -euo pipefail
9+
10+
if [[ $# -gt 0 ]]; then
11+
TARGETARCH="$1"
12+
fi
13+
14+
case $TARGETARCH in
15+
"amd64")
16+
echo "x86_64"
17+
;;
18+
"arm64")
19+
echo "aarch64"
20+
;;
21+
*)
22+
echo "No target arch mapping for $TARGETARCH." 1>&2
23+
exit 1
24+
;;
25+
esac

0 commit comments

Comments
 (0)