From 4aa1d1c2c0deaab1fc190a974d1eb20b81f6c5e0 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Sun, 9 Sep 2018 00:17:52 +0200 Subject: [PATCH] Now really build static binary...maybe slower but more portable --- Makefile | 3 ++- docker/Makefile | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 00cd69c..5eab275 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ export APP_NAME DOCKER_IMAGE_TAG GOEXE all: docker $(GOEXE): $(GOPATH)/src/$(GOPROJECT)/main.go - GOPATH=$(GOPATH) go install $(GOPROJECT) + GOPATH=$(GOPATH) go install -tags netgo \ + -ldflags '-w -extldflags "-static"' $(GOPROJECT) strip $@ docker: react $(GOEXE) diff --git a/docker/Makefile b/docker/Makefile index 8600e7e..723d307 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -2,9 +2,10 @@ BIN_DIR = data/bin DOCROOT_DIR = data/document-root LIB_DIR = data/lib64 -LIBS = $(LIB_DIR)/ld-linux-x86-64.so.2 \ - $(LIB_DIR)/libc.so.6 \ - $(LIB_DIR)/libpthread.so.0 +LIBS = +#LIBS = $(LIB_DIR)/ld-linux-x86-64.so.2 \ +# $(LIB_DIR)/libc.so.6 \ +# $(LIB_DIR)/libpthread.so.0 EXE = $(BIN_DIR)/$(APP_NAME)