diff --git a/Makefile b/Makefile index 1a4c92d..553142f 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,8 @@ buildlocalctl: make -C upctl buildlocal: - go build -ldflags "-X 'github.com/tlinden/ephemerup/cfg.VERSION=$(VERSION)'" -o $(DAEMON) +# go build -ldflags "-X 'github.com/tlinden/ephemerup/cfg.VERSION=$(VERSION)'" -o $(DAEMON) + CGO_LDFLAGS='-static' go build -tags osusergo,netgo -ldflags "-extldflags=-static -s -X 'github.com/tlinden/ephemerup/cfg.VERSION=$(VERSION)'" -o $(DAEMON) buildimage: clean docker-compose --verbose build diff --git a/mkrel.sh b/mkrel.sh index 158e2ba..e06b02f 100755 --- a/mkrel.sh +++ b/mkrel.sh @@ -44,9 +44,12 @@ for D in $DIST; do tarfile="releases/${daemon}-${os}-${arch}-${version}.tar.gz" set -x - GOOS=${os} GOARCH=${arch} go build -o ${binfile} -ldflags "-X 'github.com/tlinden/ephemerup/cfg.VERSION=${version}'" + GOOS=${os} GOARCH=${arch} CGO_LDFLAGS='-static' go build -tags osusergo,netgo -ldflags \ + "-extldflags=-static -s -X 'github.com/tlinden/ephemerup/cfg.VERSION=${version}'" -o ${binfile} + #GOOS=${os} GOARCH=${arch} go build -o ${binfile} -ldflags "-X 'github.com/tlinden/ephemerup/cfg.VERSION=${version}'" cd $client - GOOS=${os} GOARCH=${arch} go build -o ../${clientfile} -ldflags "-X 'github.com/tlinden/ephemerup/upctl/cfg.VERSION=${version}'" + GOOS=${os} GOARCH=${arch} go build -o ../${clientfile} -ldflags \ + "-X 'github.com/tlinden/ephemerup/upctl/cfg.VERSION=${version}'" cd - mkdir -p ${tardir}