Skip to content

fix(docker): build the UI bundle natively instead of under QEMU (unblocks v0.4.3 release) - #82

Merged
alexneo2003 merged 1 commit into
mainfrom
claude/fix-ui-image-arm64-qemu-hang
Oct 17, 2026
Merged

alexneo2003 merged 1 commit into
mainfrom
claude/fix-ui-image-arm64-qemu-hang

Conversation

@alexneo2003

Copy link
Copy Markdown
Contributor

Summary

The v0.4.3 release run hung for 6 hours in Build and push UI and was cancelled by the job limit. This changes one line in ui/Dockerfile so the UI image no longer runs npm ci under QEMU emulation.

What happened

In the hung run (#38520682395), the multi-arch UI build split into two branches:

  • linux/amd64 — npm ci + vite build finished in about 8 seconds.
  • linux/arm64 — npm ci -w ui crashed under QEMU and never returned:
#28 41.04 qemu: uncaught target signal 4 (Illegal instruction) - core dumped

Nothing was logged after that until the 6-hour limit cancelled the job.

The same Dockerfile built both architectures fine in the Sept 19 beta build, and nothing in the repo changed in between. The QEMU image the workflow uses (tonistiigi/binfmt:latest) and the node:22-alpine base are both unpinned, so the emulation environment changed underneath an unchanged Dockerfile. I can't tell from the log which install script died.

The change

-FROM node:22-alpine AS builder
+FROM --platform=$BUILDPLATFORM node:22-alpine AS builder

The builder stage only produces static HTML/JS/CSS, which is identical on every architecture, so it doesn't need to run once per target. With this change it runs once, natively, on the CI machine. The final nginx stage only COPYs those files in, so it is still built per target and the published linux/arm64 image is unchanged. As a side effect the UI image should build faster.

Deliberately not changed

  • Controller Dockerfile. It ships node_modules into the runtime image, which may contain per-architecture native code, so it keeps building per target. It built fine for arm64 in the same run.
  • QEMU pinning in the workflows. Not needed for this fix; the UI no longer depends on emulation.

Test plan

  • Diff is one FROM line plus a comment; COPY --from=builder paths are unchanged.
  • No Docker daemon in the authoring sandbox, so the image could not be built locally. Verification needs CI: comment /pr-beta on this PR and confirm the multi-arch UI build completes, then check the arm64 image runs (docker run --platform linux/arm64 ghcr.io/watchwarden-labs/watchwarden-ui:pr-<n>-beta).

Release note

main currently has two chore: update changelog for v0.4.3 commits (2a4923f and 6a7f7b6), one from each release attempt, and no v0.4.3 tag yet. This PR doesn't touch that.


Generated by Claude Code

The v0.4.3 release run hung for 6 hours in "Build and push UI". The
linux/amd64 half of the UI image built in seconds, but the linux/arm64
half crashed during `npm ci -w ui` under QEMU emulation:

  qemu: uncaught target signal 4 (Illegal instruction) - core dumped

and then never returned, until the 6-hour job limit cancelled the run.
The same Dockerfile built both architectures fine in the Sept 19 beta
run; the workflow's QEMU image (tonistiigi/binfmt:latest) and the
node base image are both unpinned, so the emulation environment changed
underneath an unchanged Dockerfile.

The builder stage only produces static files (HTML, JS, CSS) that are
identical on every architecture, so it does not need to run once per
target. Pin it to the CI machine's own platform with
`FROM --platform=$BUILDPLATFORM`. The npm install and vite build now run
natively and once, which removes the emulated npm ci that crashed (and
should make the UI image build faster). The final nginx stage only COPYs
the files in, so it is still built per target and the published
linux/arm64 image is unchanged.

The Controller image is deliberately left alone: it ships node_modules
into the runtime image, which may contain per-architecture native code,
and it built fine for arm64 in the same run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeNrf1VXC34bbCKDsfL4TS
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Results — ✅ All tests passed

Component Status Passed Failed
Controller (TypeScript) ✅ 267 0
Agent (Go) ✅ 153 0
UI (React) ✅ 81 0
Total ✅ 501 0

Commit: 5c65536 | Run: #104

@alexneo2003

Copy link
Copy Markdown
Contributor Author

/pr-beta

@github-actions

Copy link
Copy Markdown
Contributor

🐳 PR Beta Images Published

Service Image
Controller ghcr.io/watchwarden-labs/watchwarden-controller:pr-82-beta
Agent ghcr.io/watchwarden-labs/watchwarden-agent:pr-82-beta
UI ghcr.io/watchwarden-labs/watchwarden-ui:pr-82-beta

Commit: 8f739ea

Quick test

# Pull and run
docker pull ghcr.io/watchwarden-labs/watchwarden-controller:pr-82-beta
docker pull ghcr.io/watchwarden-labs/watchwarden-agent:pr-82-beta
docker pull ghcr.io/watchwarden-labs/watchwarden-ui:pr-82-beta

@alexneo2003
alexneo2003 merged commit 88af114 into main Oct 17, 2026
10 checks passed
@alexneo2003
alexneo2003 deleted the claude/fix-ui-image-arm64-qemu-hang branch October 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants