|
| 1 | +# Cloudflare Sandbox |
| 2 | + |
| 3 | +Secure, isolated code execution containers for [Cloudflare Workers](https://developers.cloudflare.com/workers/). Run untrusted code safely — execute commands, manage files, run background processes, and expose services from your Workers applications. |
| 4 | + |
| 5 | +## Image Variants |
| 6 | + |
| 7 | +All images are published as tags on `cloudflare/sandbox`: |
| 8 | + |
| 9 | +| Tag | Base | Description | |
| 10 | +| -------------------- | ------------ | -------------------------------------------------------------- | |
| 11 | +| `<version>` | Ubuntu 22.04 | Default — Node.js 20, Bun, Git, curl, jq, and common utilities | |
| 12 | +| `<version>-python` | Ubuntu 22.04 | Default + Python 3.11 with matplotlib, numpy, pandas, ipython | |
| 13 | +| `<version>-opencode` | Ubuntu 22.04 | Default + [OpenCode](https://opencode.ai) CLI | |
| 14 | +| `<version>-musl` | Alpine 3.21 | Minimal Alpine-based image with Git, curl, and bash | |
| 15 | +| `<version>-desktop` | Ubuntu 22.04 | Full Linux desktop (XFCE) with Xvfb, VNC, and noVNC | |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +These images are designed to be used with the [`@cloudflare/sandbox`](https://www.npmjs.com/package/@cloudflare/sandbox) SDK. Reference them in your project's `Dockerfile`: |
| 20 | + |
| 21 | +```dockerfile |
| 22 | +FROM cloudflare/sandbox:0.8.1-python |
| 23 | +``` |
| 24 | + |
| 25 | +Then configure your `wrangler.toml` to use the image: |
| 26 | + |
| 27 | +```toml |
| 28 | +[containers] |
| 29 | +image = "./Dockerfile" |
| 30 | +max_instances = 1 |
| 31 | +``` |
| 32 | + |
| 33 | +See the [Getting Started guide](https://developers.cloudflare.com/sandbox/get-started/) for a complete walkthrough. |
| 34 | + |
| 35 | +## Architecture |
| 36 | + |
| 37 | +Each image runs a lightweight HTTP server (port 3000) that the Sandbox SDK communicates with. The server handles command execution, file operations, process management, and port exposure. Images are built for `linux/amd64`. |
| 38 | + |
| 39 | +## Documentation |
| 40 | + |
| 41 | +- [Full Documentation](https://developers.cloudflare.com/sandbox/) |
| 42 | +- [API Reference](https://developers.cloudflare.com/sandbox/api/) |
| 43 | +- [Examples](https://github.com/cloudflare/sandbox-sdk/tree/main/examples) |
| 44 | +- [GitHub Repository](https://github.com/cloudflare/sandbox-sdk) |
| 45 | + |
| 46 | +## License |
| 47 | + |
| 48 | +[Apache License 2.0](https://github.com/cloudflare/sandbox-sdk/blob/main/LICENSE) |
0 commit comments