Skip to content

Commit 4ec705a

Browse files
committed
chore
1 parent 3227368 commit 4ec705a

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1919
apt-transport-https && \
2020
rm -rf /var/lib/apt/lists/*
2121

22-
# 设置npm淘宝镜像源并安装pnpm
23-
RUN npm config set registry https://registry.npmmirror.com && \
24-
# 安装指定版本的pnpm(可修改版本号)
25-
npm install -g pnpm@8 && \
26-
# 设置pnpm淘宝镜像源
22+
# 设置npm和pnpm镜像源并安装pnpm
23+
ENV PNPM_VERSION=8.17.0
24+
RUN corepack enable && \
25+
corepack prepare pnpm@${PNPM_VERSION} --activate && \
26+
npm config set registry https://registry.npmmirror.com && \
2727
pnpm config set registry https://registry.npmmirror.com && \
28-
# 清理缓存减小镜像体积
29-
npm cache clean --force && \
30-
pnpm store prune
28+
pnpm config set store-dir /pnpm-store && \
29+
rm -rf /tmp/* /root/.npm /root/.cache
3130

3231
CMD [ "/bin/bash" ]

0 commit comments

Comments
 (0)