Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 3.4 KB

File metadata and controls

94 lines (66 loc) · 3.4 KB

🐋 Chromium x Docker

This Dockerfile extends Anthropic's Computer Use reference implementation by: (1) installing headful Chromium (2) Exposing Chromium's port 9222 so Chrome DevTools Protocol-based frameworks (Playwright, Puppeteer) can connect to it.

1. Build From the Source

git clone https://github.com/onkernel/kernel-images.git
cd kernel-images
docker build -t onkernel/kernel-chromium:latest -f containers/docker/Dockerfile .

2. Run the Container

docker run -e CHROMIUM_FLAGS="--no-sandbox --disable-dev-shm-usage --disable-gpu --start-maximized --disable-software-rasterizer --remote-allow-origins=* --no-zygote" -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium

This exposes three ports:

  • 8080: Anthropic's Computer Use web application, which includes a chat interface and remote GUI
  • 6080: NoVNC interface for visual monitoring via browser-based VNC client
  • 9222: Chrome DevTools Protocol for browser automation via Playwright and Puppeteer
  • 8501: Streamlit interfaced used by Computer Use

Live View Configuration

You can set the browser width and height with the environment variables WIDTH and HEIGHT, and control Chromium startup flags with CHROMIUM_FLAGS in the docker run command:

docker run -e WIDTH=1920 -e HEIGHT=1080 \
           -e CHROMIUM_FLAGS="--start-maximized --disable-gpu" \
           -p 8501:8501 -p 8080:8080 -p 6080:6080 -p 9222:9222 kernel-chromium

👾 Connect via Chrome DevTools Protocol

We expose port 9222 via ncat, allowing you to connect Chrome DevTools Protocol-based browser frameworks like Playwright and Puppeteer (and CDP-based SDKs like Browser Use). You can use these frameworks to drive the browser in the cloud.

First, fetch the browser's CDP websocket endpoint:

const url = "http://localhost:9222/json/version";
const response = await fetch(url);
if (response.status !== 200) {
  throw new Error(
    `Failed to retrieve browser instance: ${
      response.statusText
    } ${await response.text()}`
  );
}
const { webSocketDebuggerUrl } = await response.json();

Then, connect a remote Playwright or Puppeteer client to it:

const browser = await puppeteer.connect({
  browserWSEndpoint: webSocketDebuggerUrl,
});

or:

const browser = await chromium.connectOverCDP(webSocketDebuggerUrl);

🧑‍💻 Connect via remote GUI (noVNC)

For visual monitoring, access the browser via NoVNC by opening:

http://localhost:6080/vnc.html

🛜 Connect via Anthropic Computer Use's web app

For a unified interface that includes Anthropic Computer Use's chat (via Streamlit) plus GUI (via noVNC), visit:

http://localhost:8080

🤝 License & Contributing

See here for license and contributing details.

🏅 Join our Team

We're hiring exceptional senior and staff backend engineers to work on the future of AI infrastructure. Full-time or contract-to-hire. Join a small team that punches well above its weight, minimal meetings and no bureaucracy. By developers, for developers.

$175k-200k + equity + great healthcare. Remote in the continental US.

Things we're working on: serverless, containers/vms/unikernels, streaming, SDKs, CLIs.

Message catherine jue on Discord with what you've been building lately.