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
|
esac
|
||||||
|
|
||||||
cacheVolume="buildx-cache"
|
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)
|
cacheVolume=$(docker create --name=buildx-cache -v /root/.cache -v /go/pkg/mod alpine)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
11
hack/util
11
hack/util
@ -22,10 +22,13 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CLI_PLATFORM" ]; then
|
if [ -z "$CLI_PLATFORM" ]; then
|
||||||
rawos=$(uname -s)
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
if [ "$rawos" = "Darwin" ]; then
|
arch="$(uname -m)"
|
||||||
CLI_PLATFORM="darwin/amd64"
|
if [ "$arch" = "x86_64" ]; then
|
||||||
elif uname -s | grep MINGW 2>&1 >/dev/null ; then
|
arch="amd64"
|
||||||
|
fi
|
||||||
|
CLI_PLATFORM="darwin/$arch"
|
||||||
|
elif uname -s | grep MINGW > /dev/null 2>&1 ; then
|
||||||
CLI_PLATFORM="windows/amd64"
|
CLI_PLATFORM="windows/amd64"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user