审查视图

Administrator authored
1 2
FROM 192.168.0.243:5000/mmm/allied-creation-cooperation:20210908
#FROM golang:latest
3
MAINTAINER 陈志颖 <steve.d.chan@qq.com>
yangfu authored
4
ENV APP_DIR $GOPATH/src/allied-creation-cooperation-20210909
陈志颖 authored
5 6 7 8 9 10 11
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR/
COPY ./pkg pkg
COPY ./config config
COPY ./go.mod go.mod
COPY ./go.sum go.sum
COPY ./main.go main.go
12
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
陈志颖 authored
13
ENV GO111MODULE on
14
ENV GOPROXY https://goproxy.cn
陈志颖 authored
15 16 17 18
RUN ["go","mod","tidy"]
RUN ["ls"]
RUN ["go","build"]
ENTRYPOINT ["./allied-creation-cooperation"]
陈志颖 authored
19
陈志颖 authored
20 21 22 23 24 25 26 27 28 29 30 31 32
##############################
### STEP 1 build executable binary
##############################
#FROM golang:latest AS builder
#MAINTAINER 陈志颖 <steve.d.chan@qq.com>
#RUN mkdir /app
#WORKDIR /app
#COPY . /app
#RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
#RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" CGO_ENABLED=0 GOOS=linux go build -o allied-creation-cooperation
#
##############################
### STEP 2 build a small image
陈志颖 authored
33
#############################
陈志颖 authored
34 35 36
#FROM scratch as final
#COPY --from=builder /app/allied-creation-cooperation /app/allied-creation-cooperation
#ENTRYPOINT ["./app/allied-creation-cooperation"]