docker: update dockerfile and make command

This commit is contained in:
Evgeniy Kulikov 2019-12-13 19:18:45 +03:00
parent 97d1a99f58
commit 798b9c9646
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
2 changed files with 4 additions and 4 deletions

View file

@ -6,13 +6,13 @@ ARG REPO=github.com/nspcc-dev/neofs-gw
ENV GOGC off ENV GOGC off
ENV CGO_ENABLED 0 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 WORKDIR /src
COPY . /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 # Executable image
FROM scratch FROM scratch
@ -21,3 +21,5 @@ WORKDIR /
COPY --from=builder /go/bin/neofs-gw /bin/neofs-gw COPY --from=builder /go/bin/neofs-gw /bin/neofs-gw
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/bin/neofs-gw"]

View file

@ -1,4 +1,3 @@
REPO ?= $(shell go list -m)
VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')" VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')"
HUB_IMAGE=nspccdev/neofs HUB_IMAGE=nspccdev/neofs
@ -23,7 +22,6 @@ deps:
image: deps image: deps
@echo "${B}${G}⇒ Build GW docker-image ${R}" @echo "${B}${G}⇒ Build GW docker-image ${R}"
@docker build \ @docker build \
--build-arg REPO=$(REPO) \
--build-arg VERSION=$(VERSION) \ --build-arg VERSION=$(VERSION) \
-f Dockerfile \ -f Dockerfile \
-t $(HUB_IMAGE)-http-gate:$(VERSION) . -t $(HUB_IMAGE)-http-gate:$(VERSION) .