Skip to content

Commit

Permalink
strip binaries on build
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmahanth committed Mar 26, 2024
1 parent d6272c6 commit 1bc8da9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ vendor:
go mod vendor

package-scanner: vendor $(PWD)/**/*.go $(PWD)/agent-plugins-grpc/**/*.go
CGO_ENABLED=0 go build -buildvcs=false -v .
CGO_ENABLED=0 go build -buildvcs=false -v -ldflags="-s -w -extldflags=-static" .

.PHONY: docker
docker:
Expand Down
2 changes: 1 addition & 1 deletion tools/grype-bin/get_grype.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ git clone https://github.com/anchore/grype.git --branch v$VERSION || true
(
cd grype/cmd/grype
export CGO_ENABLED=0
GOOS="$BUILD_OS" GOARCH="$BUILD_ARCH" go build -o grype.bin .
GOOS="$BUILD_OS" GOARCH="$BUILD_ARCH" go build -o grype.bin -ldflags="-s -w -extldflags=-static" .
cp grype.bin ../../../ && chmod +x grype.bin
)
2 changes: 1 addition & 1 deletion tools/syft-bin/get_syft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ git clone https://github.com/deepfence/syft.git --branch $RELEASE || true
(
cd syft/cmd/syft
export CGO_ENABLED=0
GOOS="$BUILD_OS" GOARCH="$BUILD_ARCH" go build -o syft.bin .
GOOS="$BUILD_OS" GOARCH="$BUILD_ARCH" go build -o syft.bin -ldflags="-s -w -extldflags=-static" .
cp syft.bin ../../../ && chmod +x syft.bin
)

0 comments on commit 1bc8da9

Please sign in to comment.