Skip to content

Commit

Permalink
Set GOOS,GOARCH env and ldflags option in .ci/build file (#147)
Browse files Browse the repository at this point in the history
* set GOOS,GOARCH env and ldflags option

* -w flag in --ldflags introduced
  • Loading branch information
himanshu-kun authored Aug 2, 2022
1 parent 0b089c8 commit 9768494
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .ci/build
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ fi

# If no LOCAL_BUILD environment variable is set, we configure the `go build` command
# to build for linux OS, amd64 architectures and without CGO enablement.
# ldflags used, same as Makefile , this reduces size of binary considerably
if [[ -z "$LOCAL_BUILD" ]]; then
GO111MODULE=off go build \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=off go build --ldflags="-s -w" \
-a \
-v \
-o ${BINARY_PATH}/cluster-autoscaler/cluster-autoscaler-amd64 \
Expand Down

0 comments on commit 9768494

Please sign in to comment.