作者 yangfu

修改 Dockerfile

FROM 192.168.0.243:5000/mmm/mmmopp:20200226 as builder
#FROM golang:1.13 as builder
#FROM 192.168.0.243:5000/mmm/mmmopp:20200226 as builder
FROM golang:1.13 as builder
ENV GOPROXY https://goproxy.cn
ENV GO111MODULE on
ENV GOPATH /go
#RUN git clone http://gitlab.fjmaimaimai.com/mmm-go/gocomm.git /go/src/gocomm \
RUN git clone http://gitlab.fjmaimaimai.com/mmm-go/gocomm.git /go/src/gocomm \
RUN cd /go/src/gocomm \
&& git pull
WORKDIR /go/src/opp
... ... @@ -15,14 +15,14 @@ COPY . .
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w" -o opp main.go
#FROM alpine:latest
FROM 192.168.0.243:5000/mmm/mmmopp:20200110
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --no-cache tzdata \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache ## 清除缓存
WORKDIR /root/
COPY --from=builder /go/src/opp .
#FROM 192.168.0.243:5000/mmm/mmmopp:20200110
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
# && apk add --no-cache tzdata \
# && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
# && echo "Asia/Shanghai" > /etc/timezone \
# && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache ## 清除缓存
#WORKDIR /root/
#COPY --from=builder /go/src/opp .
EXPOSE 8080
EXPOSE 443
... ...
... ... @@ -487,7 +487,7 @@ func saveApproveMsgByApproveData(header *protocol.RequestHeader, orm orm.Ormer,
code = 3
reason := ""
if len(approveData.Reason) > 0 {
reason = fmt.Sprintf(",理由:%v", approveData.Reason)
reason = fmt.Sprintf(",理由:%v\n", approveData.Reason)
}
parames = append(parames, reason, selfChecks.String())
}
... ...