Skip to content

Conversation

@ellyxir
Copy link
Contributor

@ellyxir ellyxir commented Oct 6, 2025

this first version works but still isn't finished, read packages/ralph/README.md for upcoming changes
after following instructions in packages/ralph/README.md to run the container, you can log into it, servers (toolshed/shell) will already be running.
claude has mcp playwright preconfigured.
the first time you use claude, you need to log into your account.
after that, it should work.


Summary by cubic

Adds a Docker container for Ralph that provisions the runtime stack and auto-starts the Common Tools servers. Includes docs for running the container and deploying/testing charms with Playwright.

  • New Features
    • Ubuntu 22.04 image with Node 24, Deno, GitHub CLI, Tailscale, Helix, MyST, and Playwright (Chrome) + deps.
    • Installs Claude CLI and Codex; preconfigures Claude MCP Playwright (headless, isolated, no-sandbox).
    • Creates non-root ralph user with sudo; sets /app; clones commontoolsinc/labs into /app/labs.
    • Adds start-servers.sh to launch toolshed (deno task dev) and shell (deno task dev-local) with clean shutdown.
    • Adds README for build/run/cleanup; adds DEPLOY.md with charm deploy/testing steps and appends it to labs/AGENTS.md in the image.

@ellyxir ellyxir self-assigned this Oct 6, 2025
@ellyxir ellyxir requested review from jakedahn and seefeldb October 6, 2025 18:27
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 4 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="packages/ralph/start-servers.sh">

<violation number="1" location="packages/ralph/start-servers.sh:29">
Waiting on both servers in a single wait call reports only the shell process’s status; if toolshed exits with an error, the script still returns 0 and hides that failure.</violation>
</file>

<file name="packages/ralph/README.md">

<violation number="1" location="packages/ralph/README.md:16">
The Docker run example never publishes the ports that toolshed (default 0.0.0.0:8000) and the shell server listen on, so the container starts but the services remain inaccessible from the host. Please expose the required ports in the run instructions.</violation>
</file>

<file name="packages/ralph/Dockerfile">

<violation number="1" location="packages/ralph/Dockerfile:56">
`apt-get install helix` runs without `-y`, causing the non-interactive Docker build to hang/fail.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

- Add -y flag for non-interactive helix installation
- Expose ports 8000:8000 and 5173:5173 in README example
- Fix start-servers.sh to properly report server failures
Comment on lines 39 to 45
# Helix editor
# need to install add-apt-repository from
# software-properties-common package
RUN apt-get install -y --no-install-recommends software-properties-common
RUN add-apt-repository -y ppa:maveonair/helix-editor && \
apt-get update && \
apt-get install -y helix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is helix needed her, like do you actually edit code within a ralph container?

I thought you would mount a workspace directory into ralph, then any edits you would make would be from your local filesystem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i cant do anything without helix so i added it :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But like, you shouldn't really be doing much of anything inside the container other than chatting with agents, right?

My mental model is to use docker as the isolation layer to prevent ralph from destroying my development environment, but it's still nice/helpful to edit files from the host (outside the container) where you have all of your own dev tools setup.

You can do this with a bind or volume mount, like:

docker run --volume <host-path>:<container-path>
docker run --name ralph --volume /path/to/host/labs:/app/labs -p 8000:8000 -p 5173:5173 ellyxir/ralph

Then you would edit your code on your host at /path/to/host/labs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, but when im testing the docker container, i cant edit any files to test stuff with. i can try to use vim but im terribly bad at it.

Comment on lines 55 to 58
# Create ralph user (with sudo privileges for development)
RUN useradd -m -s /bin/bash ralph && \
apt-get update && apt-get install -y sudo && \
echo "ralph ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
Copy link
Contributor

@jakedahn jakedahn Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a throw-away container like ralph, is there benefit to creating a ralph user here, instead of just using root?

This would save some downstream complexity where we have to manage ownership/chown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chrome starts to whine when its root and you can get around it. i thought overall that its better if LLM couldnt change all the aspects of the OS and system. i'd probably get rid of sudo also once it settles.

Comment on lines +90 to +92
# Configure Claude MCP server for ralph user
# --no-sandbox is required because Docker containers restrict namespace creation
RUN claude mcp add --scope user playwright npx "@playwright/mcp@latest" -- --headless --isolated --no-sandbox
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a similar approach for registering an mcp server with codex?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but exactly the same but in the README.md i have a TODO item to do just that, in a followup PR


# Create ralph user (with sudo privileges for development)
RUN useradd -m -s /bin/bash ralph && \
apt-get update && apt-get install -y sudo && \
Copy link
Contributor

@jakedahn jakedahn Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Dockerfiles, each RUN command is treated as an image cache layer-- so the best practice is to run apt update and apt install as few times as possible, as far to the top as possible.

This also saves ~30s per apt update and apt install during container image build time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consolidated apt updates

@ellyxir ellyxir merged commit 2fe7c01 into main Oct 7, 2025
8 checks passed
@ellyxir ellyxir deleted the ellyse/docker-container-ralph branch October 7, 2025 19:53
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.

4 participants