summaryrefslogtreecommitdiffstats
path: root/sms-service/src
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2018-03-09 11:49:24 -0800
committerKiran Kamineni <kiran.k.kamineni@intel.com>2018-03-20 15:17:43 -0700
commitd5fd81a4b5940da7a3a787271abd069b7d12ea86 (patch)
tree0a6ff85f6e6dde178eb3f18614acc336836bf4c9 /sms-service/src
parent8b58db1c4ce07f4ee093079d8fa5310b4d06cb17 (diff)
Making the build completely static for docker
Making the build static is good for deployment on a container. There is no need to worry about installing dependencies and so on. Issue-ID: AAF-182 Change-Id: I6bb34ccae423886d9154b2a713b81911f739e9ff Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'sms-service/src')
-rw-r--r--sms-service/src/sms/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/sms-service/src/sms/Makefile b/sms-service/src/sms/Makefile
index 2751fff..25c12e1 100644
--- a/sms-service/src/sms/Makefile
+++ b/sms-service/src/sms/Makefile
@@ -1,5 +1,6 @@
GOPATH := $(shell realpath "$(PWD)/../../")
BINARY := sms
+PLATFORM := linux
DEPENDENCIES := github.com/golang/dep/cmd/dep
export GOPATH ...
@@ -8,7 +9,9 @@ all: test build
deploy: test build
build: deps format
- go build -o $(GOPATH)/target/$(BINARY) -v sms.go
+ CGO_ENABLED=0 GOOS=$(PLATFORM) go build -a \
+ -ldflags '-extldflags "-static"' \
+ -o $(GOPATH)/target/$(BINARY) -v sms.go
clean:
go clean