Skip to content

Commit 94a048e

Browse files
committed
corepack enable
1 parent 6aaea86 commit 94a048e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,14 @@ RUN apt-get update && \
2323
# 注:|| true 避免脚本中非致命错误导致构建失败(如提示 Shell 切换)
2424
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
2525

26-
# 4. 配置三大包管理工具 + 国内源(核心需求,确保依赖拉取加速)
27-
RUN true \
28-
# npm 配置 npmmirror 国内源
29-
&& npm config set registry https://registry.npmmirror.com \
30-
# 启用 corepack 并安装最新版 yarn
31-
&& corepack enable \
32-
&& corepack prepare yarn@stable --activate \
33-
# yarn 配置 npmmirror 国内源(yarn 4+ 新语法)
34-
&& yarn config set npmRegistryServer "https://registry.npmmirror.com" \
35-
# pnpm 配置 npmmirror 国内源 + 优化存储
36-
&& pnpm config set registry https://registry.npmmirror.com \
37-
&& pnpm config set store-dir ~/.pnpm-store
26+
# 4. 配置包管理工具源
27+
RUN npm config set registry https://registry.npmmirror.com && \
28+
# 启用 corepack
29+
corepack enable && \
30+
# 配置包管理工具源
31+
yarn config set registry https://registry.npmmirror.com && \
32+
pnpm config set registry https://registry.npmmirror.com && \
33+
pnpm config set store-dir ~/.pnpm-store
3834

3935
# 5. 基础环境配置(工作目录+数据卷,方便开发时挂载本地代码)
4036
RUN mkdir -p /workspace

0 commit comments

Comments
 (0)