mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-06-22 02:43:34 +02:00
dockcross-command.sh: support multi-arch tags
This commit is contained in:
@ -4,8 +4,14 @@ if (( $# >= 2 )); then
|
||||
image_complet=$1
|
||||
image=${image_complet%:*}
|
||||
tag=${image_complet#*:}
|
||||
host_arch=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')
|
||||
if test $tag = $image; then
|
||||
tag="latest"
|
||||
# use multiarch image if available
|
||||
if docker images | grep dockcross/${image} | grep latest-${host_arch} >/dev/null; then
|
||||
tag="latest-${host_arch}"
|
||||
else
|
||||
tag="latest"
|
||||
fi
|
||||
fi
|
||||
shift 1
|
||||
|
||||
@ -16,7 +22,7 @@ if (( $# >= 2 )); then
|
||||
# docker pull "dockcross/$image:$tag"
|
||||
|
||||
echo "Make script dockcross-$image"
|
||||
docker run --rm dockcross/"$image" > ./dockcross-"$image"
|
||||
docker run --rm dockcross/"$image:$tag" > ./dockcross-"$image"
|
||||
chmod +x ./dockcross-"$image"
|
||||
|
||||
echo "Run command in dockcross-$image"
|
||||
|
Reference in New Issue
Block a user