fix(docker): 设 ENV CI=true 跳过 lefthook prepare 钩子
docker build 无 .git 目录,lefthook install 报 fatal:not a git repository。 设 CI=true 让 is-ci 短路,prepare 脚本(is-ci || lefthook install)跳过 lefthook。
This commit is contained in:
parent
b529446ec7
commit
a00f63d7be
@ -4,8 +4,10 @@
|
||||
FROM 43.134.235.58:58080/dockerhub-proxy/library/node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# 装 git:lefthook 的 prepare 钩子(is-ci || pnpm exec lefthook install)需要 git
|
||||
# 装 git + 设 CI=true:lefthook 的 prepare 钩子(is-ci || lefthook install)在 CI 环境
|
||||
# 会因 is-ci 短路跳过;docker build 无 .git 目录,lefthook install 会 fatal
|
||||
RUN apk add --no-cache git
|
||||
ENV CI=true
|
||||
|
||||
# 全局装 pnpm(与本地 11.x 对齐;corepack 在 alpine 上不可靠)
|
||||
RUN npm install -g pnpm@11
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user