From 1d651dd7edcc07e382f0fb8ccf1fbf1aff6c1a66 Mon Sep 17 00:00:00 2001 From: Vikram Rangnekar Date: Fri, 27 Sep 2019 02:30:07 -0400 Subject: [PATCH] Add binary compression back to Dockerfile --- Dockerfile | 13 +++++-------- serv/cmd.go | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7110835..c2487cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,7 @@ RUN apk update && \ apk add --no-cache git && \ apk add --no-cache upx=3.95-r2 -RUN go get -u github.com/dosco/esc && \ - go get -u github.com/shanzi/wu && \ +RUN go get -u github.com/shanzi/wu && \ go install github.com/shanzi/wu && \ go get github.com/GeertJohan/go.rice/rice @@ -24,13 +23,11 @@ COPY --from=react-build /web/build/ ./web/build/ ENV GO111MODULE=on RUN go mod vendor -# RUN go generate ./... && \ -# CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o super-graph && \ -# upx --ultra-brute -qq super-graph && \ -# upx -t super-graph - RUN go generate ./... && \ - CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o super-graph + CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o super-graph && \ + echo "Compressing binary, will take a bit of time..." && \ + upx --ultra-brute -qq super-graph && \ + upx -t super-graph # stage: 3 FROM alpine:latest diff --git a/serv/cmd.go b/serv/cmd.go index a9c94b9..7af1c36 100644 --- a/serv/cmd.go +++ b/serv/cmd.go @@ -17,6 +17,8 @@ import ( "github.com/spf13/viper" ) +//go:generate rice embed-go + const ( serverName = "Super Graph"