From a7abd476f05436e6eb435cbf93f655253e5162d4 Mon Sep 17 00:00:00 2001 From: MiFaZhan Date: Thu, 29 Oct 2026 13:42:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20runtime=20=E9=98=B6=E6=AE=B5=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20tzdata=EF=BC=8C=E5=8E=BB=E6=8E=89=E4=BB=8E=20builde?= =?UTF-8?q?r=20=E6=8B=B7=E8=B4=9D=20zoneinfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原 Dockerfile 的 runtime 用私有 alpine 镜像(预装 tzdata), 换成公共 alpine:3.23 后缺少 /usr/share/zoneinfo,且 builder 是 golang:alpine 也没有该文件,构建报 cache key not found。 改为 runtime 阶段 apk add tzdata,并删除 COPY --from=builder。 --- server/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Dockerfile b/server/Dockerfile index a3e8c4c..6498042 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -34,7 +34,8 @@ ENV APP_UPLOAD_DIR=/data/app/iotlcmadmin-web-svc/upload WORKDIR /app -COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai +# runtime 基础镜像不含 tzdata,单独安装(原私有镜像已预装,公共镜像没有) +RUN apk add --no-cache ca-certificates tzdata COPY --from=builder /out/iotlcm-app-server /app/iotlcm-app-server COPY resource/public /app/resource/public