From 698854dca39988dc3ef6b4fdb70dfcbea9c30f95 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) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wenmanxiang Signed-off-by: 李龙峰 --- 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}" \