change Dockerfile增加包管理代理环境变量

main
dugulp 2024-08-01 02:20:55 +08:00
parent 6833477292
commit b75050914d
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,10 @@ RUN go mod download
# 复制源代码
COPY . .
# 设置环境变量
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.io,direct
# 构建应用
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .