From bc846f48b4a608077b10a58c8d1b6277842b710c Mon Sep 17 00:00:00 2001 From: Nicolas Carlier Date: Fri, 22 Dec 2023 22:02:52 +0000 Subject: [PATCH] chore(): build static binary --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f0167ca..2443aae 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,5 @@ .SILENT : -export GO111MODULE=on - # App name APPNAME=webhookd @@ -27,7 +25,8 @@ BUILT:=`date` define LDFLAGS -X '$(PKG_VERSION).Version=$(VERSION)' \ -X '$(PKG_VERSION).GitCommit=$(GIT_COMMIT)' \ --X '$(PKG_VERSION).Built=$(BUILT)' +-X '$(PKG_VERSION).Built=$(BUILT)' \ +-s -w -buildid= endef all: build @@ -46,7 +45,7 @@ clean: build: -mkdir -p release echo ">>> Building: $(EXECUTABLE) $(VERSION) for $(GOOS)-$(GOARCH) ..." - GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -o release/$(EXECUTABLE) + GOOS=$(GOOS) GOARCH=$(GOARCH) go build -tags osusergo,netgo -ldflags "$(LDFLAGS)" -o release/$(EXECUTABLE) .PHONY: build release/$(EXECUTABLE): build