Skip to content

docs: add a dev container for Linux-consistent headed runs - #420

Open
FRSgit wants to merge 2 commits into
feat/major-5from
docs/devcontainer
Open

FRSgit wants to merge 2 commits into
feat/major-5from
docs/devcontainer

Conversation

@FRSgit

@FRSgit FRSgit commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

One of the cheap items from the #212 list: instead of fighting macOS vs Linux font rendering, run cypress open inside Linux and review the diffs there.

This adds a .devcontainer/ folder that works for this repo and doubles as a copy-paste reference for anyone using the plugin. It's a single devcontainer.json, no Dockerfile:

  • cypress/browsers:node-24.21.0-chrome-153.0.8010.36-1-ff-156.0-edge-153.0.4234.32-1 (same Node as .nvmrc, Chrome/Firefox/Edge preinstalled, amd64 + arm64)
  • the desktop-lite feature, so you get a small Fluxbox desktop with noVNC on port 6080 and can click around in the Cypress app from your normal browser
  • --shm-size=2g, because Chrome and Electron fall over on Docker's 64 MB default
  • postCreateCommand does corepack + pnpm install + build + cypress verify

The README next to it explains why this exists, how to open it (VS Code, CLI, Codespaces), how to run pnpm test:e2e headed and see it, fonts (and the honest part: byte-identical output only happens if CI runs in the same image, there's a two-line container: snippet for that), Docker alternatives on macOS, Apple Silicon and --platform=linux/amd64, the Codespaces --shm-size caveat, how this pairs with the opt-in {platform} token for imagesPath (#422), and where it sits in the #212 plan: this is the full-fidelity "whole runner in Linux" option, the core path in RENDERER-DESIGN.md is a renderer sidecar that keeps Cypress native and headed and only moves the rendering into a pinned container, and the run-cypress CLI helper will be the scripted version of what this folder does by hand. The plugin README got a FAQ entry pointing at it and CONTRIBUTING mentions it as an optional way to work on the repo.

A couple of things I checked while writing this, since they change the config:

  • the image runs as root and has no node user (it's built from a plain Debian trixie base, Node is installed by script), so remoteUser is root; the doc says how to add a user via common-utils if you care
  • it sets CI=1 in the image env, which I unset in containerEnv so interactive tooling behaves normally
  • it installs no fonts of its own beyond what the Chrome package pulls in, hence the fonts section

I built it here with the devcontainer CLI on Apple Silicon (arm64) and it came up fine: the desktop-lite feature installed, postCreateCommand ran through (pnpm 12.5.1, install, build, cypress verify against /root/.cache/Cypress/16.1.0), node -v is v24.21.0, DISPLAY is :1 and CI is unset in a fresh shell, the VNC/noVNC processes are running, and pnpm test:integration passes inside the container. What I didn't do is the headed part, so before or right after merging:

  • pnpm test:e2e shows the Cypress app on port 6080 and the Batch Review carousel can approve an image into __image_snapshots_local__
  • "Reopen in Container" also builds on an amd64 machine (the image is multi-arch, I only had arm64 at hand)

Refs: #212

🤖 Generated with Claude Code

A copy-paste `.devcontainer/` reference (cypress/browsers image, desktop-lite
noVNC desktop, --shm-size) so `cypress open` can run inside Linux and the
review UI approves the same pixels CI produces. Docs cover fonts and the parity
caveat, Docker alternatives on macOS, Apple Silicon, Codespaces and how it
pairs with per-platform baselines. README FAQ and CONTRIBUTING link to it.

Refs: #212

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…er sidecar

The per-platform section now shows the opt-in {platform} token instead of
calling it the v5 default, and a new section explains where this sits in
the #212 plan: full-fidelity runner-in-Docker (this container, later the
run-cypress helper) versus the DOM renderer sidecar that keeps Cypress
native and headed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant