From 95a7613d15289db416effda1c4e90535ad0ebd6e Mon Sep 17 00:00:00 2001 From: Tiago Ilieve Date: Fri, 2 Feb 2024 10:35:50 -0300 Subject: [PATCH] Disable CGO 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. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d040dd9..b521cc9 100644 --- a/Makefile +++ b/Makefile @@ -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/