修复: Dockerfile 在 go mod download 前拷贝 third_party
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:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user