fix: runtime 阶段安装 tzdata,去掉从 builder 拷贝 zoneinfo
原 Dockerfile 的 runtime 用私有 alpine 镜像(预装 tzdata), 换成公共 alpine:3.23 后缺少 /usr/share/zoneinfo,且 builder 是 golang:alpine 也没有该文件,构建报 cache key not found。 改为 runtime 阶段 apk add tzdata,并删除 COPY --from=builder。
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user