From 26a87c992a75126675fca2b6d60bf6692ef4c19e Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Mon, 10 Dec 2018 11:06:20 +0530 Subject: [PATCH] Make binaries actually static https://github.com/grafana/loki/pull/49 broke promtail with standard_init_linux.go:178: exec user process caused "no such file or directory" From https://medium.com/@diogok/on-golang-static-binaries-cross-compiling-and-plugins-1aed33499671 CGO_ENABLED=0 makes it static, afaics Signed-off-by: Goutham Veeramachaneni --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1609a1172257..b25df307eae4 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,7 @@ $(EXES) $(PROTO_GOS) $(YACC_GOS) lint test shell check-generated-files: loki-bui else $(EXES): loki-build-image/$(UPTODATE) - go build $(GO_FLAGS) -o $@ ./$(@D) + CGO_ENABLED=0 go build $(GO_FLAGS) -o $@ ./$(@D) $(NETGO_CHECK) %.pb.go: loki-build-image/$(UPTODATE)