From 8ba44717913ef6d99d34d16fc52ee2a54348c887 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Thu, 28 May 2026 21:24:28 -0700 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20Dockerfile=20=E5=9C=A8=20?= =?UTF-8?q?go=20mod=20download=20=E5=89=8D=E6=8B=B7=E8=B4=9D=20third=5Fpar?= =?UTF-8?q?ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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"。 --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c040309..51dff90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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