修复: Dockerfile 在 go mod download 前拷贝 third_party
Build docker and publish / build (20.15.1) (push) Failing after 26m23s
Build docker and publish / build (20.15.1) (pull_request) Failing after 24m3s

fefbd4f5 (#104) 引入了 replace github.com/zeromicro/go-zero => ./third_party/gozero,
但 Dockerfile 只 COPY 了 go.mod/go.sum, 导致 go mod download 找不到 replace 目标
报 "open /build/third_party/gozero/go.mod: no such file or directory"。
This commit is contained in:
2026-05-28 21:24:28 -07:00
parent 3e265bd837
commit 8ba4471791
+2 -1
View File
@@ -12,8 +12,9 @@ RUN apk update --no-cache && apk add --no-cache tzdata ca-certificates
WORKDIR /build
# Copy go.mod and go.sum first to take advantage of Docker caching
# Copy go.mod, go.sum, and replace targets (third_party) before downloading deps
COPY go.mod go.sum ./
COPY third_party/ ./third_party/
RUN go mod download
# Copy the rest of the application code