Skip to content

Commit 7fad86f

Browse files
committed
fix: static compile, disable CGO
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent dd3af9b commit 7fad86f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ GOMODULE=$(shell grep ^module $(ROOT_DIR)/go.mod | awk '{ print $$2 }')
1212
# Set version strings based on git tag and current ref
1313
GO_LDFLAGS=-ldflags "-s -w -X '$(GOMODULE)/internal/version.Version=$(shell git describe --tags --exact-match 2>/dev/null)' -X '$(GOMODULE)/internal/version.CommitHash=$(shell git rev-parse --short HEAD)'"
1414

15+
# Alias for building program binary
16+
build: $(BINARY)
17+
1518
mod-tidy:
1619
go mod tidy
1720

1821
# Build our program binary
1922
# Depends on GO_FILES to determine when rebuild is needed
2023
$(BINARY): mod-tidy $(GO_FILES)
21-
go build \
24+
CGO_ENABLED=0 go build \
2225
$(GO_LDFLAGS) \
2326
-o $(BINARY) \
2427
./cmd/$(BINARY)
2528

2629
.PHONY: build clean image mod-tidy
2730

28-
# Alias for building program binary
29-
build: $(BINARY)
30-
3131
clean:
3232
rm -f $(BINARY)
3333

0 commit comments

Comments
 (0)