Skip to content

Commit e9c4951

Browse files
committed
fix: 修复镜像构建异常,简化构建步骤、处理逻辑
1 parent 77b1817 commit e9c4951

4 files changed

Lines changed: 19 additions & 89 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# CONTAINER_BUILD: 采用容器构建
77
#
88

9-
FROM registry.cn-hangzhou.aliyuncs.com/142vip-infra/node:20.18.0-alpine AS build_base
9+
FROM registry.cn-hangzhou.aliyuncs.com/142vip-infra/node:25.9.0-base AS build_base
1010

1111
# 是否配置代理
12-
ARG NEED_PROXY_BUILD=false
12+
ARG NEED_PROXY
1313

1414
ENV NODE_OPTIONS="--max-old-space-size=200000"
1515
# 设置环境变量,支持容器构建时使用layer缓存,参考:https://pnpm.io/zh/docker
@@ -25,7 +25,7 @@ COPY . .
2525

2626
# 基于容器自动构建
2727
RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci --ignore-scripts && \
28-
if [ "$NEED_PROXY_BUILD" = "false" ]; \
28+
if [ "$NEED_PROXY" = "false" ]; \
2929
then \
3030
pnpm build; \
3131
else \

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@142vip/eslint-config": "0.0.1-alpha.5",
3333
"@142vip/fairy-cli": "0.0.3-alpha.30",
3434
"@142vip/open-source": "0.0.1-alpha.3",
35-
"@142vip/utils": "0.0.1-alpha.50",
35+
"@142vip/utils": "0.0.1-alpha.52",
3636
"@142vip/vuepress": "0.0.1-alpha.18",
3737
"only-allow": "1.2.1",
3838
"simple-git-hooks": "2.13.0",

pnpm-lock.yaml

Lines changed: 14 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/core/build-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function buildImageMain() {
2525
imageName: realImageName,
2626
buildArgs: [
2727
// 参数中是否包含 --proxy
28-
['NEED_PROXY_BUILD', VipNodeJS.getProcessArgv().includes('--proxy')],
28+
['NEED_PROXY', VipNodeJS.getProcessArgv().includes('--proxy')],
2929
['APP_NAME', name],
3030
['APP_VERSION', version],
3131
['APP_DESCRIPTION', description],

0 commit comments

Comments
 (0)