From 94a12cc2caf2b04f4099d06faa358043e765865d Mon Sep 17 00:00:00 2001 From: wenmanxiang Date: Sun, 12 Mar 2023 17:06:04 +0800 Subject: [PATCH] feat:add default build param GOOS GOARCH Change-Id: I518b41e71e22b699db3c34c378c79a8237ca6fb0 --- hack/docker-build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/docker-build.sh b/hack/docker-build.sh index 5bdf623fdb1..63b36ece6b0 100755 --- a/hack/docker-build.sh +++ b/hack/docker-build.sh @@ -17,6 +17,9 @@ GOPROXY=${GOPROXY:-`go env GOPROXY`} GOTAGS=${GOTAGS:-} GOGCFLAGS=${GOGCFLAGS:-} +GOOS=${GOOS:-linux} +GOARCH=${GOARCH:-amd64} + # enable bash debug output DEBUG=${DEBUG:-} @@ -27,6 +30,7 @@ fi docker-build() { name=$1 docker build \ + --platform ${GOOS}/${GOARCH} \ --build-arg CGO_ENABLED="${CGO_ENABLED}" \ --build-arg GOPROXY="${GOPROXY}" \ --build-arg GOTAGS="${GOTAGS}" \