From 6e5920cc09a10f532ccbadc83f074b9491e14ef5 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 6 Aug 2020 16:32:36 +0300 Subject: [PATCH] use -trimpath build flag for more reproducible builds Fix #349. --- Dockerfile | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 04b9b1cda..7dd749887 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN set -x \ && export GO111MODULE=on \ && export CGO_ENABLED=0 \ && export LDFLAGS="-X ${REPO}/pkg/config.Version=${VERSION}" \ - && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli + && go build -trimpath -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli # Executable image FROM alpine diff --git a/Makefile b/Makefile index 50c944628..e6bcce52f 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build: deps @set -x \ && export GOGC=off \ && export CGO_ENABLED=0 \ - && go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go + && go build -trimpath -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go neo-go.service: neo-go.service.template @sed -r -e 's_BINDIR_$(BINDIR)_' -e 's_UNITWORKDIR_$(UNITWORKDIR)_' -e 's_SYSCONFIGDIR_$(SYSCONFIGDIR)_' $< >$@