File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2121
2222 - name : 设置Docker Buildx
2323 uses : docker/setup-buildx-action@v2
24- # 您可以尝试只保留最常用的平台,例如 linux/amd64 和 linux/arm64
2524 with :
26- platforms : linux/amd64,linux/arm64
25+ platforms : linux/amd64,linux/arm64 # 严格限制这两个
2726
2827 - name : 登录 GitHub Container Registry
2928 uses : docker/login-action@v2
3332 password : ${{ secrets.GHCR_TOKEN }}
3433
3534 - name : 构建并推送多架构Docker镜像
36- uses : docker/build-push-action@v3
35+ uses : docker/build-push-action@v3 # 或者考虑升级到 v4 或 v5,如果可用
3736 with :
3837 context : .
39- platforms : linux/amd64,linux/arm6
38+ platforms : linux/amd64,linux/arm64 # 严格与上面保持一致
4039 push : true
4140 tags : ghcr.io/${{ github.repository_owner }}/vue-xiuxiangame:latest
Original file line number Diff line number Diff line change 11# 构建阶段
2- FROM node:20-bullseye-slim AS build
2+ # 尝试使用 node:lts (长期支持版本) 或 node:20 (Node.js 20的默认Debian基础镜像)
3+ FROM node:lts AS build
4+ # 或者 FROM node:20 AS build
35WORKDIR /app
46COPY . .
57RUN npm install && \
68npm run build
79
810# 运行阶段
9- FROM node:20-bullseye-slim AS runtime
11+ # 保持与构建阶段一致
12+ FROM node:lts AS runtime
13+ # 或者 FROM node:20 AS runtime
1014WORKDIR /app
1115COPY --from=build /app/dist /app
1216RUN npm install -g http-server
You can’t perform that action at this time.
0 commit comments