From 56cf73dead1b0cbb31cad176a0e794fa8206c84c Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Fri, 15 May 2026 16:11:22 -0700 Subject: [PATCH 1/2] fix: allow resume of stopped coderunner container Closes #4 --- README.md | 20 ++++++++++++++++++++ install.sh | 23 ++++++++++++++--------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 463c076..86aa379 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,26 @@ chmod +x install.sh ./install.sh ``` +### Stop and resume + +Stop the sandbox when you are done: + +```bash +container stop coderunner +``` + +Resume the same sandbox later, preserving uploads, kernels, and installed packages: + +```bash +container start coderunner +``` + +To start over with a clean sandbox, delete the container and run the installer again: + +```bash +container delete coderunner && ./install.sh +``` + ## Run Claude Code inside a Sandbox diff --git a/install.sh b/install.sh index cdbc6ea..5232a1a 100755 --- a/install.sh +++ b/install.sh @@ -82,12 +82,6 @@ echo "Running: container system property set dns.domain local" container system property set dns.domain local -echo "Pulling the latest image: instavm/coderunner" -if ! container image pull instavm/coderunner; then - echo "❌ Failed to pull image. Please check your internet connection and try again." - exit 1 -fi - echo "→ Ensuring coderunner assets directories…" ASSETS_SRC="$HOME/.coderunner/assets" mkdir -p "$ASSETS_SRC/skills/user" @@ -98,14 +92,25 @@ echo "Stopping any existing coderunner container..." container stop coderunner 2>/dev/null || true sleep 2 +echo "Trying to resume any existing coderunner container..." +if container start coderunner 2>/dev/null; then + echo "✅ Setup complete. MCP server is available at http://coderunner.local:8222/mcp" + exit 0 +fi + +echo "Pulling the latest image: instavm/coderunner" +if ! container image pull instavm/coderunner; then + echo "❌ Failed to pull image. Please check your internet connection and try again." + exit 1 +fi + # Run the command to start the sandbox container -echo "Running: container run --name coderunner --detach --rm --cpus 8 --memory 4g instavm/coderunner" +echo "Running: container run --name coderunner --detach --cpus 8 --memory 4g instavm/coderunner" if container run \ --volume "$ASSETS_SRC/skills/user:/app/uploads/skills/user" \ --volume "$ASSETS_SRC/outputs:/app/uploads/outputs" \ --name coderunner \ --detach \ - --rm \ --cpus 8 \ --memory 4g \ instavm/coderunner; then @@ -113,4 +118,4 @@ if container run \ else echo "❌ Failed to start coderunner container. Please check the logs with: container logs coderunner" exit 1 -fi \ No newline at end of file +fi From 8462521783093ad865717f37a67b3106faf96bfb Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Fri, 15 May 2026 16:38:52 -0700 Subject: [PATCH 2/2] fix(install.sh): include --volume flags in startup echo The log message printed before starting the coderunner container omitted the --volume mounts that are actually applied. With the volumes added in this PR for state persistence, surfacing them in the echo helps users debug their setup. Co-Authored-By: Claude Opus 4.7 (1M context) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5232a1a..2726492 100755 --- a/install.sh +++ b/install.sh @@ -105,7 +105,7 @@ if ! container image pull instavm/coderunner; then fi # Run the command to start the sandbox container -echo "Running: container run --name coderunner --detach --cpus 8 --memory 4g instavm/coderunner" +echo "Running: container run --volume \"$ASSETS_SRC/skills/user:/app/uploads/skills/user\" --volume \"$ASSETS_SRC/outputs:/app/uploads/outputs\" --name coderunner --detach --cpus 8 --memory 4g instavm/coderunner" if container run \ --volume "$ASSETS_SRC/skills/user:/app/uploads/skills/user" \ --volume "$ASSETS_SRC/outputs:/app/uploads/outputs" \