2020-02-27 23:18:47 -08:00
|
|
|
FROM golang:1.13.8 as builder
|
2020-03-09 23:16:22 -07:00
|
|
|
ARG GOPROXY=direct
|
2020-01-08 05:57:14 -08:00
|
|
|
WORKDIR /go/src/ehang.io/nps
|
2019-11-27 06:46:34 -08:00
|
|
|
COPY . .
|
|
|
|
RUN go get -d -v ./...
|
|
|
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go
|
|
|
|
|
|
|
|
FROM scratch
|
2020-01-08 05:57:14 -08:00
|
|
|
COPY --from=builder /go/src/ehang.io/nps/nps /
|
|
|
|
COPY --from=builder /go/src/ehang.io/nps/web /web
|
2019-11-27 06:46:34 -08:00
|
|
|
VOLUME /conf
|
|
|
|
CMD ["/nps"]
|