Repository navigation
fix(claude-code): consolidate onto system Chromium to shrink image - #83
Merged
Merged
Conversation
The daily-rebuilt image grew from ~600MB to ~1.07GB because two Chromium installs ran side-by-side: Playwright's --only-shell bake (which still pulls Firefox+WebKit despite the flag) and apt chromium pulled transitively by agent-browser install --with-deps. Align with the project's own .claude/rules/dockerfile.md convention: install system chromium via apt and set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 + PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium. Drop the Playwright install-deps and browser-bake RUNs, drop the redundant npx playwright install from both devcontainer.json postCreate/updateContent commands, and move the agent-browser install to run as the node user so no subsequent chown -R duplicates 452MB of claude-code files via overlayfs. Measured (linux/amd64): - default: ~1.07GB -> 660MB (-38%) - sandbox: 3.09GB -> 350MB (-89%) Closes #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Shrinks the daily-rebuilt
claude-codedevcontainer image by consolidating onto a single system Chromium and eliminating achown-induced layer duplication.Why
Per issue #82, the image grew from ~600MB to ~1.07GB. Root cause: two Chromium installs ran side-by-side — Playwright's
--only-shellbake (which still pulls Firefox+WebKit despite the flag) and aptchromiumpulled transitively byagent-browser install --with-deps. A separatechown -Rlayer was also rewriting ~452MB of claude-code files into a new layer via overlayfs.The project's own
.claude/rules/dockerfile.mdalready specifies system Chromium +PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1— the Dockerfile had drifted from that convention.Changes
chromium+fonts-freefont-ttfvia apt in thedefaulttarget (kept out ofbasesosandboxstays lean).PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1andPLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium.install-deps chromiumandinstall --only-shellRUNs; dropARG PLAYWRIGHT_VERSION.npm install -g @anthropic-ai/claude-codeandnpm install -g agent-browserasUSER nodeso no follow-upchown -Rduplicates files in a new layer.rm -rf /root/.localafter copying the binary).npx playwright install --only-shell chromiumfrompostCreateCommand/updateContentCommand.PLAYWRIGHT_VERSIONfrom the Build Args table.Notes
Breaking change for consumers: projects that use
@playwright/testmust readprocess.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATHin theirplaywright.config.ts. Playwright does not read this env var automatically — it's a project convention. Projects relying on the old "runplaywright installat container creation" step should drop it.Measured (linux/amd64)
Verified
claude,mise,fish,rtk,ralphex,chromium,agent-browser(default);iptables(sandbox)Closes #82