From 91498c475f2bd4a6d0babbda9b3ea7e8fcf1be51 Mon Sep 17 00:00:00 2001 From: tianma-if Date: Sun, 25 Oct 2026 13:14:29 +0800 Subject: [PATCH] fix(docker): build the web bundle on the runner architecture QEMU arm64 hangs inside Vite and the publish job is cancelled at 60 minutes. The bundle is plain JavaScript, so the build stage uses the runner platform and only the Bun runtime image stays per architecture. --- Dockerfile | 5 ++++- scripts/docker-release.test.mjs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b80746bb..b4e9d427 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ # syntax=docker/dockerfile:1.7 -FROM oven/bun:1.3.14-alpine AS manifests +# The web bundle and self-hosted server are plain JavaScript. Build them on the +# runner's own architecture. QEMU arm64 hangs in Vite until the publish job hits +# its timeout. The runtime image below still follows the target architecture. +FROM --platform=$BUILDPLATFORM oven/bun:1.3.14-alpine AS manifests WORKDIR /app COPY package.json bun.lock bunfig.toml ./ diff --git a/scripts/docker-release.test.mjs b/scripts/docker-release.test.mjs index b1d59bc0..de458113 100644 --- a/scripts/docker-release.test.mjs +++ b/scripts/docker-release.test.mjs @@ -58,6 +58,7 @@ describe("Docker release contract", () => { dockerfile.indexOf("FROM oven/bun:1.3.14-alpine AS runtime"), ); const packageMetadata = JSON.parse(readProjectFile("package.json")); + expect(dockerfile).toContain("FROM --platform=$BUILDPLATFORM oven/bun:1.3.14-alpine AS manifests"); expect(dockerfile).toContain("FROM oven/bun:1.3.14-alpine AS runtime"); expect(dockerfile).toContain("COPY patches patches"); expect(dockerfile).toContain("COPY docs docs");