FROM harbor.homieyy.com/base/golang:1.20.5 AS builder #ENV CGO_ENABLED 0 #ENV GOOS linux COPY . /src WORKDIR /src #RUN export GIT_TERMINAL_PROMPT=1 #RUN git config --global url."git.gz.internal.jumaiyx.cn:222".insteadof "https://git.gz.internal.jumaiyx.cn/" #RUN go env -w GOPROXY="https://goproxy.cn" #RUN go env -w GOINSECURE="git.gz.internal.jumaiyx.cn" #RUN go env -w GOPRIVATE="git.gz.internal.jumaiyx.cn/" #RUN go env -w GONOSUMDB="git.gz.internal.jumaiyx.cn/" #RUN go env -w GONOPROXY="git.gz.internal.jumaiyx.cn/" #RUN go env RUN go mod tidy RUN go build ./cmd/main.go FROM harbor.homieyy.com/base/alpine:3.13 RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata WORKDIR /app COPY --from=builder /src/main /app/main COPY --from=builder /src/configs /app/configs #EXPOSE 9000 ENTRYPOINT ["./main"]