From d6364739c532a65613d45b8cc7bb8dc6420c1400 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 13 May 2021 17:16:27 +0300 Subject: [PATCH] Dockerfile: use make to build neo-go Don't duplicate go build invocation line there. --- Dockerfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7dd749887..e2c4747fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1-alpine as builder RUN set -x \ - && apk add --no-cache git \ + && apk add --no-cache git make \ && mkdir -p /tmp COPY . /neo-go @@ -12,14 +12,7 @@ WORKDIR /neo-go ARG REPO=repository 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 GOGC=off \ - && export GO111MODULE=on \ - && export CGO_ENABLED=0 \ - && export LDFLAGS="-X ${REPO}/pkg/config.Version=${VERSION}" \ - && go build -trimpath -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli +RUN make build # Executable image FROM alpine @@ -31,7 +24,7 @@ WORKDIR / COPY --from=builder /neo-go/config /config COPY --from=builder /neo-go/.docker/privnet-entrypoint.sh /usr/bin/privnet-entrypoint.sh -COPY --from=builder /go/bin/neo-go /usr/bin/neo-go +COPY --from=builder /neo-go/bin/neo-go /usr/bin/neo-go COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ ENTRYPOINT ["/usr/bin/privnet-entrypoint.sh"]