Skip to content

Commit b7e8320

Browse files
committed
fix(docker): builder阶段安装ca-certificates,修复go mod download失败
1 parent 18cf64a commit b7e8320

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ FROM golang:1.21-alpine AS builder
55
WORKDIR /app
66

77
# 安装必要的包
8-
RUN apk add --no-cache git
8+
# - git:部分依赖可能需要走 VCS 拉取
9+
# - ca-certificates:Alpine 默认可能缺失 CA,导致 go mod download TLS 失败
10+
RUN apk add --no-cache git ca-certificates && update-ca-certificates
911

1012
# 复制go mod文件
1113
COPY go.mod go.sum ./

0 commit comments

Comments
 (0)