Dockerfile 474 B

1234567891011121314151617181920212223
  1. FROM golang:1.13-alpine AS builder
  2. LABEL stage=gobuilder
  3. ENV CGO_ENABLED 0
  4. ENV GOOS linux
  5. ENV GOPROXY https://goproxy.cn,direct
  6. WORKDIR $GOPATH/src/zero
  7. COPY . .
  8. RUN go build -ldflags="-s -w" -o /app/unaryserver example/rpc/server/unary/server.go
  9. FROM alpine
  10. RUN apk add --no-cache tzdata
  11. ENV TZ Asia/Shanghai
  12. WORKDIR /app
  13. COPY --from=builder /app/unaryserver /app/unaryserver
  14. COPY example/rpc/server/unary/etc/k8s.json /app/
  15. CMD ["./unaryserver", "-f", "k8s.json"]