From f53cc8d4ab58ee451bb28b47aa4d748144193078 Mon Sep 17 00:00:00 2001 From: Garen Wen Date: Thu, 16 Mar 2023 14:55:50 +0800 Subject: [PATCH] feat:add default build param GOOS GOARCH (#2155) Co-authored-by: wenmanxiang --- 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}" \