-
Notifications
You must be signed in to change notification settings - Fork 9
Ellyse/docker container ralph #1872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
use chrome instead of chromium since its what playwright seems to want add claude mcp add command for playwright
…md in dockerfile, fixed formatting
27a9582 to
1a9cc97
Compare
…md in dockerfile, fixed formatting
There was a problem hiding this 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
tools/ralph/Dockerfile
Outdated
| # 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
… system level stuff
tools/ralph/Dockerfile
Outdated
|
|
||
| # Create ralph user (with sudo privileges for development) | ||
| RUN useradd -m -s /bin/bash ralph && \ | ||
| apt-get update && apt-get install -y sudo && \ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consolidated apt updates
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.