diff --git a/Dockerfile b/Dockerfile index c8114db1c..8bbcaa4ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,9 @@ ARG VERSION=dev # https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away # go build -mod=vendor RUN set -x \ - && export BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ && export GOGC=off \ && export CGO_ENABLED=0 \ - && export LDFLAGS="-X ${REPO}/config.Version=${VERSION} -X ${REPO}/config.BuildTime=${BUILD_TIME}" \ + && export LDFLAGS="-X ${REPO}/config.Version=${VERSION}" \ && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/node ./cli/main.go # Executable image diff --git a/Makefile b/Makefile index 02d05f42a..06cb00b08 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,18 @@ BRANCH = "master" -BUILD_TIME = "$(shell date -u +\"%Y-%m-%dT%H:%M:%SZ\")" REPONAME = "neo-go" NETMODE ?= "privnet" +BINARY = "./bin/neo-go" REPO ?= "$(shell go list -m)" VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')" -BUILD_FLAGS = "-X $(REPO)/config.Version=$(VERSION) -X $(REPO)/config.BuildTime=$(BUILD_TIME)" +BUILD_FLAGS = "-X $(REPO)/config.Version=$(VERSION)" build: deps @echo "=> Building binary" @set -x \ && export GOGC=off \ && export CGO_ENABLED=0 \ - && echo $(VERSION)-$(BUILD_TIME) \ - && go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ./bin/node ./cli/main.go + && go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go image: deps @echo "=> Building image" @@ -46,7 +45,7 @@ push-to-registry: @docker push CityOfZion/${REPONAME} run: build - ./bin/neo-go node -config-path ./config -${NETMODE} + ${BINARY} node -config-path ./config -${NETMODE} run-cluster: build-linux @echo "=> Starting docker-compose cluster" diff --git a/config/config.go b/config/config.go index 67eed94d6..e5e856f35 100644 --- a/config/config.go +++ b/config/config.go @@ -25,10 +25,6 @@ const ( var ( // Version the version of the node, set at build time. Version string - - // BuildTime the time and date the current version of the node built, - // set at build time. - BuildTime string ) type (