Dockerfile 501 B

12345678910111213141516171819202122
  1. FROM golang:1.13 AS builder
  2. ENV CGO_ENABLED 0
  3. ENV GOOS linux
  4. WORKDIR $GOPATH/src/zero
  5. COPY . .
  6. RUN go build -ldflags="-s -w" -o /app/gracefulrpc example/graceful/dns/rpc/gracefulrpc.go
  7. FROM alpine
  8. RUN apk update --no-cache
  9. RUN apk add --no-cache ca-certificates
  10. RUN apk add --no-cache tzdata
  11. ENV TZ Asia/Shanghai
  12. WORKDIR /app
  13. COPY --from=builder /app/gracefulrpc /app/gracefulrpc
  14. COPY example/graceful/dns/rpc/etc/config.json /app/etc/config.json
  15. CMD ["./gracefulrpc", "-f", "etc/config.json"]