dockerimg: fix Chromium support with multi-stage Docker build
OMG, people, OMG. So, an earlier commit moved us to Ubuntu, and it turns
out that "apt-get install chromium-browser" or whatever just does
nothing, and tells you to use the snap. Snap requires systemd, and if
you're using containers, you don't usually have systemd, and ... yeah,
no screenshots. There are no great stories for where to get Chromium.
There's a dude who publishes the Mint Linux packages in a compatible way
for Ubuntu. I chose instead the headless-chrome from a Docker build
recommended by the Chromedp library that we use to control Chromium.
I'm a bit snappy about all of this.
...
Replace Ubuntu 24 snap-based Chromium installation with chromedp/headless-shell
to resolve container compatibility issues where snaps don't work properly.
Changes include:
1. Multi-stage Dockerfile.base build:
- Stage 1: Extract headless-shell from docker.io/chromedp/headless-shell:stable
- Stage 2: Main Ubuntu 24.04 application image with required Chrome dependencies
- Remove chromium package from apt-get install (replaced with headless-shell)
- Add required libraries: libglib2.0-0, libnss3, libx11-6, libxcomposite1,
libxdamage1, libxext6, libxi6, libxrandr2, libgbm1, libgtk-3-0
- Add headless-shell to PATH so chromedp can find it automatically
2. Updated documentation in browse/README.md:
- Document Docker multi-stage build approach
- Clarify requirements for Docker vs local development
Benefits:
- Resolves Ubuntu 24 snap incompatibility issues in containers
- Provides self-contained Chrome installation without system dependencies
- Maintains backward compatibility for local development
- Uses proven chromedp/headless-shell for reliable browser automation
- Eliminates need for manual Chrome/Chromium installation in containers
- No code changes needed in browse.go - chromedp finds headless-shell via PATH
The headless-shell binary is automatically discovered by chromedp's default
executable search since it's added to PATH in the Docker environment.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: se4808dca7afba802k
diff --git a/claudetool/browse/README.md b/claudetool/browse/README.md
index 7cc3437..69ebf07 100644
--- a/claudetool/browse/README.md
+++ b/claudetool/browse/README.md
@@ -35,6 +35,8 @@
## Requirements
- Chrome or Chromium must be installed on the system
+- In Docker environments, the multi-stage build automatically provides headless-shell from chromedp/headless-shell
+- For local development, install Chrome/Chromium manually
- The `chromedp` package handles launching and controlling the browser
## Tool Input/Output