diff --git a/.circleci/config.yml b/.circleci/config.yml index 0723232c6..8b57811b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,11 +87,11 @@ jobs: curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz tar -xz -C /tmp -f /tmp/docker-$VER.tgz mv /tmp/docker/* /usr/bin - - run: make build-image + - run: make image workflows: - version: 2.1 + version: 2 workflow: jobs: - vet: diff --git a/Dockerfile b/Dockerfile index 8bbcaa4ad..d48897746 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,12 @@ ARG VERSION=dev # go build -mod=vendor RUN set -x \ && export GOGC=off \ + && export GO111MODULE=on \ && export CGO_ENABLED=0 \ && export LDFLAGS="-X ${REPO}/config.Version=${VERSION}" \ - && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/node ./cli/main.go + && go mod tidy -v \ + && go mod vendor \ + && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli/main.go # Executable image FROM alpine:3.10 @@ -31,9 +34,9 @@ WORKDIR / ENV NETMODE=testnet COPY --from=builder /neo-go/config /config -COPY --from=builder /go/bin/node /usr/bin/node +COPY --from=builder /go/bin/neo-go /usr/bin/neo-go COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -ENTRYPOINT ["/usr/bin/node"] +ENTRYPOINT ["/usr/bin/neo-go"] -CMD ["node", "--config-path", "./config", "--testnet"] +CMD ["neo-go", "--config-path", "./config", "--testnet"] diff --git a/Makefile b/Makefile index 06cb00b08..13d47163e 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ build: deps && export CGO_ENABLED=0 \ && go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go -image: deps +image: @echo "=> Building image" @docker build -t cityofzion/neo-go:latest --build-arg REPO=$(REPO) --build-arg VERSION=$(VERSION) . @docker build -t cityofzion/neo-go:$(VERSION) --build-arg REPO=$(REPO) --build-arg VERSION=$(VERSION) .