签入版本
This commit is contained in:
parent
c8f69e554e
commit
1531662d85
@ -22,6 +22,12 @@ WORKDIR /tmp
|
|||||||
|
|
||||||
# 安装必要的系统依赖和配置环境
|
# 安装必要的系统依赖和配置环境
|
||||||
RUN set -eux; \
|
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 && \
|
apt-get update && \
|
||||||
@ -71,6 +77,10 @@ RUN set -eux; \
|
|||||||
echo "=== Go Environment ==="; \
|
echo "=== Go Environment ==="; \
|
||||||
go env && \
|
go env && \
|
||||||
\
|
\
|
||||||
|
# 设置GOPROXY为国内镜像加速后续的go get操作
|
||||||
|
go env -w GOPROXY=https://goproxy.cn,direct; \
|
||||||
|
go env -w GOSUMDB=off; \
|
||||||
|
\
|
||||||
# 简单的Go程序编译测试
|
# 简单的Go程序编译测试
|
||||||
echo 'package main; import "fmt"; func main() { fmt.Println("Go环境安装成功!") }' > /tmp/test.go && \
|
echo 'package main; import "fmt"; func main() { fmt.Println("Go环境安装成功!") }' > /tmp/test.go && \
|
||||||
go run /tmp/test.go && \
|
go run /tmp/test.go && \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user