From d5fd81a4b5940da7a3a787271abd069b7d12ea86 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Fri, 9 Mar 2018 11:49:24 -0800 Subject: 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 --- sms-service/src/sms/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sms-service') 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 -- cgit 1.2.3-korg