mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-03 09:57:41 +08:00
Merge pull request #372 from thaJeztah/arch_detect
hack/util: take other arches into account on Darwin
This commit is contained in:
commit
1c7434a8f0
@ -35,7 +35,7 @@ case $buildmode in
|
||||
esac
|
||||
|
||||
cacheVolume="buildx-cache"
|
||||
if ! docker inspect "$cacheVolume" 2>&1 >/dev/null ; then
|
||||
if ! docker inspect "$cacheVolume" > /dev/null 2>&1 ; then
|
||||
cacheVolume=$(docker create --name=buildx-cache -v /root/.cache -v /go/pkg/mod alpine)
|
||||
fi
|
||||
|
||||
|
15
hack/util
15
hack/util
@ -22,11 +22,14 @@ else
|
||||
fi
|
||||
|
||||
if [ -z "$CLI_PLATFORM" ]; then
|
||||
rawos=$(uname -s)
|
||||
if [ "$rawos" = "Darwin" ]; then
|
||||
CLI_PLATFORM="darwin/amd64"
|
||||
elif uname -s | grep MINGW 2>&1 >/dev/null ; then
|
||||
CLI_PLATFORM="windows/amd64"
|
||||
fi
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
arch="$(uname -m)"
|
||||
if [ "$arch" = "x86_64" ]; then
|
||||
arch="amd64"
|
||||
fi
|
||||
CLI_PLATFORM="darwin/$arch"
|
||||
elif uname -s | grep MINGW > /dev/null 2>&1 ; then
|
||||
CLI_PLATFORM="windows/amd64"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user