12345678910111213141516171819202122232425262728293031 |
- FROM golang:1.17-alpine as build
- WORKDIR /app/kpt-tmr
- COPY . .
- RUN mkdir -p ./bin
- RUN go env -w GO111MODULE=on && \
- go env -w GOPROXY=https://goproxy.cn,direct && \
- go env -w CGO_ENABLED=0 && \
- go env -w GOARCH=amd64 && \
- go env -w GOOS=linux && \
- go build -o ./bin/kptTmr -ldflags "-X kpt.kptyun.cn:3000/kpt-event/kpt-tmr/pod.appVersion=tmr" main.go
- RUN ls -l && pwd
- FROM alpine:latest
- LABEL name="kpt-tmr" \
- description="pt service" \
- owner="yiping.xu"
- WORKDIR /app/kpt-tmr
- COPY --from=0 /app/kpt-tmr/conf/ /app/kpt-tmr/bin/conf/
- COPY --from=0 /app/kpt-tmr/bin/kptTmr /app/kpt-tmr/bin/kptTmr
- EXPOSE 8081
- VOLUME ["/app/kpt-tmr/logger","/app/kpt-tmr/bin/conf/"]
- CMD ["/app/kpt-tmr/bin/kptTmr"]
|