From 798b9c9646a57ad17e86f645cf98e66346f29591 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Fri, 13 Dec 2019 19:18:45 +0300 Subject: [PATCH] docker: update dockerfile and make command --- Dockerfile | 6 ++++-- Makefile | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e28b96..fe791e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,13 @@ ARG REPO=github.com/nspcc-dev/neofs-gw ENV GOGC off ENV CGO_ENABLED 0 -ENV LDFLAGS "-w -s -X ${REPO}/Version=${VERSION} -X ${REPO}/Build=${BUILD}" +ENV LDFLAGS "-w -s -X main.Version=${VERSION}" WORKDIR /src COPY . /src -RUN go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neofs-gw ./ +RUN go build -v -mod=vendor -ldflags "${LDFLAGS} -X main.Build=$(date -u +%s%N)" -o /go/bin/neofs-gw ./ # Executable image FROM scratch @@ -21,3 +21,5 @@ WORKDIR / COPY --from=builder /go/bin/neofs-gw /bin/neofs-gw COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +ENTRYPOINT ["/bin/neofs-gw"] diff --git a/Makefile b/Makefile index 3abbeca..5721fe1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -REPO ?= $(shell go list -m) VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')" HUB_IMAGE=nspccdev/neofs @@ -23,7 +22,6 @@ deps: image: deps @echo "${B}${G}⇒ Build GW docker-image ${R}" @docker build \ - --build-arg REPO=$(REPO) \ --build-arg VERSION=$(VERSION) \ -f Dockerfile \ -t $(HUB_IMAGE)-http-gate:$(VERSION) .