From 73fd2ee3727310df37e5f6cefe35fa513a756419 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 08 Feb 2026 07:16:06 +0000 Subject: [PATCH] Install OpenClaw and Claude in sandboxes Switch Cloudflare base to node:24-slim and copy the sandbox binary; add git, curl and ca-certificates, expose port 3000 and set ENTRYPOINT. Add OpenClaw install to Daytona and Vercel Dockerfiles and scripts. Improve logging to report Node/Claude/OpenClaw versions and adjust Deno sandbox creation and PATH. Add deno deploy org and a .dockerignore for daytona --- .sandbox/cloudflare/Dockerfile | 18 ++++++++++++++++-- .sandbox/daytona/.dockerignore | 1 + .sandbox/daytona/Dockerfile | 3 +++ .sandbox/daytona/index.ts | 3 +++ .sandbox/deno/deno.json | 3 +++ .sandbox/deno/main.ts | 12 ++++++++++-- .sandbox/vercel/index.ts | 12 ++++++++++++ .sandbox/cloudflare/src/index.ts | 13 ++++++++++++- 8 file(s) changed, 60 insertion(s)(+), 5 deletion(s)(-) diff --git a/.sandbox/cloudflare/Dockerfile b/.sandbox/cloudflare/Dockerfile --- a/.sandbox/cloudflare/Dockerfile +++ b/.sandbox/cloudflare/Dockerfile @@ -1,7 +1,21 @@ -FROM docker.io/cloudflare/sandbox:0.7.0 +FROM node:24-slim + +COPY --from=docker.io/cloudflare/sandbox:0.7.0 /container-server/sandbox /sandbox RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-client + openssh-client \ + git \ + curl \ + ca-certificates + +RUN curl -fsSL https://openclaw.ai/install.sh | bash || true + +RUN npm install -g @anthropic-ai/claude-code + +WORKDIR /workspace # Required during local development to access exposed ports EXPOSE 8080 +EXPOSE 3000 + +ENTRYPOINT ["/sandbox"] diff --git a/.sandbox/daytona/.dockerignore b/.sandbox/daytona/.dockerignore new file mode 100644 --- /dev/null +++ b/.sandbox/daytona/.dockerignore @@ -0,0 +1,1 @@ +node_modules diff --git a/.sandbox/daytona/Dockerfile b/.sandbox/daytona/Dockerfile new file mode 100644 --- /dev/null +++ b/.sandbox/daytona/Dockerfile @@ -0,0 +1,3 @@ +FROM daytonaio/sandbox:0.5.2 + +RUN curl -fsSL https://openclaw.ai/install.sh | bash || true diff --git a/.sandbox/daytona/index.ts b/.sandbox/daytona/index.ts --- a/.sandbox/daytona/index.ts +++ b/.sandbox/daytona/index.ts @@ -31,6 +31,9 @@ consola.info("SSH keys uploaded to sandbox."); + const openclaw = await sandbox.process.executeCommand("which openclaw"); + consola.log(openclaw.result); + await sandbox.process.executeCommand("chmod 600 ${HOME}/.ssh/id_rsa"); await sandbox.process.executeCommand( "ssh-keyscan -t rsa tangled.org >> ${HOME}/.ssh/known_hosts", diff --git a/.sandbox/deno/deno.json b/.sandbox/deno/deno.json --- a/.sandbox/deno/deno.json +++ b/.sandbox/deno/deno.json @@ -7,5 +7,8 @@ "@std/assert": "jsr:@std/assert@1", "chalk": "npm:chalk@^5.6.2", "consola": "npm:consola@^3.4.2" + }, + "deploy": { + "org": "tsirysndr" } } diff --git a/.sandbox/deno/main.ts b/.sandbox/deno/main.ts --- a/.sandbox/deno/main.ts +++ b/.sandbox/deno/main.ts @@ -3,9 +3,14 @@ import chalk from "chalk"; export async function main() { - const HOME = "/home/app"; + await using sandbox = await Sandbox.create({ + root: Deno.env.get("SANDBOX_ROOT"), + }); - await using sandbox = await Sandbox.create(); + const HOME = await sandbox.env.get("HOME"); + const PATH = await sandbox.env.get("PATH"); + await sandbox.env.set("PATH", `${HOME}/.npm-global/bin:/usr/bin:${PATH}`); + consola.info("Sandbox created with ID:", chalk.greenBright(sandbox.id)); await sandbox.sh`mkdir -p $HOME/.ssh`; @@ -31,6 +36,9 @@ await sandbox.sh`git clone git@tangled.org:rocksky.app/rocksky rocksky -b main`; await sandbox.sh`ls -la rocksky`; + + await sandbox.sh`which claude`; + await sandbox.sh`which openclaw`; await sandbox.close(); } diff --git a/.sandbox/vercel/index.ts b/.sandbox/vercel/index.ts --- a/.sandbox/vercel/index.ts +++ b/.sandbox/vercel/index.ts @@ -25,6 +25,17 @@ consola.info("SSH keys uploaded to sandbox."); +consola.info("Installing openclaw..."); + +await sandbox.runCommand({ + cmd: "sh", + args: ["-c", "curl -fsSL https://openclaw.ai/install.sh | bash || true"], + stdout: process.stdout, + stderr: process.stderr, +}); + +consola.info("Configuring SSH and Git..."); + await sandbox.runCommand({ cmd: "chmod", args: ["600", `${HOME}/.ssh/id_rsa`], @@ -77,6 +88,7 @@ }); try { + // await sandbox.snapshot(); // await sandbox.stop(); } catch (e) { consola.error("Error stopping Vercel Sandbox:", e); diff --git a/.sandbox/cloudflare/src/index.ts b/.sandbox/cloudflare/src/index.ts --- a/.sandbox/cloudflare/src/index.ts +++ b/.sandbox/cloudflare/src/index.ts @@ -31,8 +31,19 @@ const clone = await sandbox.exec( "git clone git@tangled.org:rocksky.app/rocksky rocksky -b main", ); - consola.log(clone.stdout); + consola.info(clone.stdout); const ls = await sandbox.exec("ls -la rocksky"); + consola.info(ls.stdout); + + const node = await sandbox.exec("node -v"); + consola.info(`Node version in sandbox: ${node.stdout.trim()}`); + + const claude = await sandbox.exec("claude --version"); + consola.info(`Claude version in sandbox: ${claude.stdout.trim()}`); + + const openclaw = await sandbox.exec("openclaw --version"); + consola.info(`OpenClaw version in sandbox: ${openclaw.stdout.trim()}`); + return Response.json({ output: ls.stdout, error: ls.stderr, -- tangled.sh