Dockerfile.nps 327 B

123456789101112
  1. FROM golang:1.15 as builder
  2. ARG GOPROXY=direct
  3. WORKDIR /go/src/ehang.io/nps
  4. COPY . .
  5. RUN go get -d -v ./...
  6. RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go
  7. FROM scratch
  8. COPY --from=builder /go/src/ehang.io/nps/nps /
  9. COPY --from=builder /go/src/ehang.io/nps/web /web
  10. VOLUME /conf
  11. CMD ["/nps"]