diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 347a5369..09e9b61b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,7 +37,7 @@ jobs: run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Build Go binary - run: go build -ldflags "-X main.GitCommit=$GITHUB_SHA -X main.GitRef=$GITHUB_REF -X main.Version=${RELEASE_TAG:-commit-$GITHUB_SHA}" -o bin/castai-agent . + run: go build -ldflags "-s -w -X main.GitCommit=$GITHUB_SHA -X main.GitRef=$GITHUB_REF -X main.Version=${RELEASE_TAG:-commit-$GITHUB_SHA}" -o bin/castai-agent . env: GOOS: linux GOARCH: amd64 diff --git a/Makefile b/Makefile index f50fcc21..5849c23d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ build: - GOOS=linux go build -o bin/castai-agent . + GOOS=linux -ldflags="-s -w" go build -o bin/castai-agent . docker build -t castai/agent:$(VERSION) . push: