From 1531662d85bc4b78311d2caf5a2a6be67af2e648 Mon Sep 17 00:00:00 2001 From: gitadmin Date: Thu, 18 Sep 2025 22:45:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=85=A5=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dockerfiles/golang/1.25.1-debian12-dos/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dockerfiles/golang/1.25.1-debian12-dos/Dockerfile b/dockerfiles/golang/1.25.1-debian12-dos/Dockerfile index b82f079..cda0548 100644 --- a/dockerfiles/golang/1.25.1-debian12-dos/Dockerfile +++ b/dockerfiles/golang/1.25.1-debian12-dos/Dockerfile @@ -22,6 +22,12 @@ WORKDIR /tmp # 安装必要的系统依赖和配置环境 RUN set -eux; \ + \ + # 配置阿里云Debian镜像源 + echo "deb http://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware" > /etc/apt/sources.list; \ + echo "deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware" >> /etc/apt/sources.list; \ + echo "deb http://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware" >> /etc/apt/sources.list; \ + echo "deb http://mirrors.aliyun.com/debian-security bookworm-security main non-free non-free-firmware" >> /etc/apt/sources.list; \ \ # 更新系统并安装基础工具 apt-get update && \ @@ -71,6 +77,10 @@ RUN set -eux; \ echo "=== Go Environment ==="; \ go env && \ \ + # 设置GOPROXY为国内镜像加速后续的go get操作 + go env -w GOPROXY=https://goproxy.cn,direct; \ + go env -w GOSUMDB=off; \ + \ # 简单的Go程序编译测试 echo 'package main; import "fmt"; func main() { fmt.Println("Go环境安装成功!") }' > /tmp/test.go && \ go run /tmp/test.go && \