1234567891011121314151617181920212223242526272829303132333435363738 |
- 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
- RUN ls -l /usr/share && ls -l /usr/share/zoneinfo
- RUN apk add --no-cache tzdata \
- && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
- && echo "Asia/Shanghai" > /etc/timezone \
- && date
- 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"]
|