use -trimpath build flag for more reproducible builds

Fix #349.
This commit is contained in:
Roman Khimov 2020-08-06 16:32:36 +03:00
parent eee457ae49
commit 6e5920cc09
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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)_' $< >$@