Skip to content

Commit

Permalink
Disable CGO
Browse files Browse the repository at this point in the history
This will enable static linking on Linux hosts, avoiding errors like
'/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found' when
deploying binaries on older Linux distributions.
  • Loading branch information
myhro committed Feb 2, 2024
1 parent 8841aaf commit 95a7613
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VERSION ?= $(shell ./scripts/version.sh)

build:
mkdir -p dist/
go build -ldflags="-s -w -X main.version=$(VERSION)" -o dist/$(BINARY)
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(VERSION)" -o dist/$(BINARY)

clean:
rm -rf dist/
Expand Down

0 comments on commit 95a7613

Please sign in to comment.