From 3aaa9fb876203a925c40125b2865c44d3270e13e Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Thu, 18 Jan 2018 14:01:24 +0000 Subject: [PATCH] tune Makefile: clean binary; make static binary --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a06568f7a..8b0d9e9ea 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ test: rbdplugin: if [ ! -d ./vendor ]; then dep ensure; fi - go build -i -o _output/rbdplugin ./rbd + CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -i -o _output/rbdplugin ./rbd container: rbdplugin cp _output/rbdplugin deploy/docker @@ -33,4 +33,5 @@ container: rbdplugin clean: go clean -r -x + rm -f deploy/docker/rbdplugin -rm -rf _output