Dockerfile 766 B

123456789101112131415161718192021222324252627
  1. FROM golang:1.17-alpine as build
  2. WORKDIR /app/kpt-tmr-group
  3. COPY . .
  4. RUN go env -w GO111MODULE=on && \
  5. go env -w GOPROXY=https://goproxy.cn,direct && \
  6. go env -w CGO_ENABLED=0 && \
  7. go env -w GOARCH=amd64 && \
  8. go env -w GOOS=linux && \
  9. go build -o ./kptTmrGroup -ldflags "-X kpt.kptyun.cn:3000/kpt-event/kpt-tmr-group/pod.appVersion=tmrGroup" main.go
  10. FROM alpine:latest
  11. LABEL name="kpt-tmr-group" \
  12. description="pt service" \
  13. owner="yiping.xu"
  14. WORKDIR /app/kpt-tmr-group
  15. COPY --from=0 /app/kpt-tmr-group/config/ /app/kpt-tmr-group/config/
  16. COPY --from=0 /app/kpt-tmr-group/kptTmrGroup /app/kpt-tmr-group/kptTmrGroup
  17. EXPOSE 8090
  18. VOLUME ["/app/kpt-tmr-group/logger","/app/kpt-tmr-group/config"]
  19. CMD ["/app/kpt-tmr-group/kptTmrGroup","http"]