2019-11-06 12:33:46 +00:00
|
|
|
FROM golang:1-alpine as builder
|
|
|
|
|
|
|
|
ARG BUILD=now
|
|
|
|
ARG VERSION=dev
|
|
|
|
ARG REPO=github.com/nspcc-dev/neofs-gw
|
|
|
|
|
|
|
|
ENV GOGC off
|
|
|
|
ENV CGO_ENABLED 0
|
2019-12-13 16:18:45 +00:00
|
|
|
ENV LDFLAGS "-w -s -X main.Version=${VERSION}"
|
2019-11-06 12:33:46 +00:00
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
COPY . /src
|
|
|
|
|
2019-12-13 16:18:45 +00:00
|
|
|
RUN go build -v -mod=vendor -ldflags "${LDFLAGS} -X main.Build=$(date -u +%s%N)" -o /go/bin/neofs-gw ./
|
2019-11-06 12:33:46 +00:00
|
|
|
|
|
|
|
# Executable image
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
|
|
|
COPY --from=builder /go/bin/neofs-gw /bin/neofs-gw
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
2019-12-13 16:18:45 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/neofs-gw"]
|