From 2c2bd911e13032e9cc71e11adf91b8bb31b52d46 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Mon, 12 Aug 2019 00:27:10 +0300 Subject: [PATCH] [build] Add support for static server builds --- scripts/z-run | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/z-run b/scripts/z-run index d4d7dd2..d649c4d 100644 --- a/scripts/z-run +++ b/scripts/z-run @@ -44,10 +44,12 @@ test "${#}" -eq 0 _outputs="$( exec -- readlink -e -- ./.outputs )" mkdir -p -- "${_outputs}/binaries/release" + export -- CGO_ENABLED=0 exec -- "${ZRUN[@]}" ':: go / tool' \ build \ -v \ - -ldflags 'all=-s' \ + -tags netgo \ + -ldflags 'all=-s -extld gcc -extldflags "-static"' \ -gcflags 'all=-l=4' \ -o "${_outputs}/binaries/release/kawipiko-server" \ -- ./cmd/server.go \