chore(docker): 更新 Go 代理配置以提升构建速度
- 在 Dockerfile 中使用多个国内 Go 代理镜像源,提升可用性和速度。 - 代理源顺序为 goproxy.cn、goproxy.io、阿里云镜像,确保构建过程更加高效。
This commit is contained in:
parent
3da3d9186a
commit
bb73dbe25e
|
|
@ -1,7 +1,9 @@
|
|||
FROM golang:1.25-alpine AS builder
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GO111MODULE=on
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
# 使用多个国内 Go 代理镜像源,提高可用性和速度
|
||||
# 顺序:goproxy.cn(七牛云) -> goproxy.io -> mirrors.aliyun.com(阿里云) -> direct(直连)
|
||||
ENV GOPROXY=https://goproxy.cn,https://goproxy.io,https://mirrors.aliyun.com/goproxy/,direct
|
||||
# 确保 PATH 包含 Go bin 目录,以便 protoc 能找到插件
|
||||
ENV PATH=$PATH:/go/bin
|
||||
# 配置 Alpine 国内镜像源(阿里云)
|
||||
|
|
|
|||
Loading…
Reference in New Issue