作者 陈志颖

chore:还原构建

正在显示 1 个修改的文件 包含 31 行增加31 行删除
#FROM golang:latest
#MAINTAINER 陈志颖 <steve.d.chan@qq.com>
#ENV APP_DIR $GOPATH/src/allied-creation-cooperation
#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
#RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
#ENV GO111MODULE on
#ENV GOPROXY https://goproxy.io
#RUN ["go","mod","tidy"]
#RUN ["ls"]
#RUN ["go","build"]
#ENTRYPOINT ["./allied-creation-cooperation"]
#############################
## STEP 1 build executable binary
#############################
FROM golang:latest AS builder
FROM golang:latest
MAINTAINER 陈志颖 <steve.d.chan@qq.com>
RUN mkdir /app
WORKDIR /app
COPY . /app
ENV APP_DIR $GOPATH/src/allied-creation-cooperation
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
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
ENV GO111MODULE on
ENV GOPROXY https://goproxy.io
RUN ["go","mod","tidy"]
RUN ["ls"]
RUN ["go","build"]
ENTRYPOINT ["./allied-creation-cooperation"]
##############################
### 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
#############################
## STEP 2 build a small image
############################
FROM scratch as final
COPY --from=builder /app/allied-creation-cooperation /app/allied-creation-cooperation
ENTRYPOINT ["./app/allied-creation-cooperation"]
\ No newline at end of file
#FROM scratch as final
#COPY --from=builder /app/allied-creation-cooperation /app/allied-creation-cooperation
#ENTRYPOINT ["./app/allied-creation-cooperation"]
\ No newline at end of file
... ...