From bb73dbe25e5f168d861cafa8ee20756fa5cfd44a Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Sat, 20 Dec 2025 15:35:22 +0800 Subject: [PATCH] =?UTF-8?q?chore(docker):=20=E6=9B=B4=E6=96=B0=20Go=20?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=85=8D=E7=BD=AE=E4=BB=A5=E6=8F=90=E5=8D=87?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Dockerfile 中使用多个国内 Go 代理镜像源,提升可用性和速度。 - 代理源顺序为 goproxy.cn、goproxy.io、阿里云镜像,确保构建过程更加高效。 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0d54c3..766e31d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 国内镜像源(阿里云)