Dockerfile 364 B

12345678910111213141516171819202122
  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/pub example/etcd/pub/pub.go
  9. FROM alpine
  10. RUN apk add --no-cache tzdata
  11. ENV TZ Asia/Shanghai
  12. WORKDIR /app
  13. COPY --from=builder /app/pub /app/pub
  14. CMD ["./pub"]