You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this guide, you will deploy a Worker that can make requests to one or more Containers in response to end-user requests.
11
11
In this example, each container runs a small webserver written in Go.
@@ -17,10 +17,9 @@ This example Worker should give you a sense for simple Container use, and provid
17
17
### Ensure Docker is running locally
18
18
19
19
In this guide, we will build and push a container image alongside your Worker code. By default, this process uses
20
-
[Docker](https://www.docker.com/) to do so. You must have Docker running locally when you run `wrangler deploy`. For most people, the best way to install Docker is to follow the [docs for installing Docker Desktop](https://docs.docker.com/desktop/). Other tools like [Colima](https://github.com/abiosoft/colima) may also work.
20
+
[Docker](https://www.docker.com/) to do so.
21
21
22
-
You can check that Docker is running properly by running the `docker info` command in your terminal. If Docker is running, the command will succeed. If Docker is not running,
23
-
the `docker info` command will hang or return an error including the message "Cannot connect to the Docker daemon".
22
+
<Renderproduct="containers"file="docker-setup" />
24
23
25
24
{/* FUTURE CHANGE: Add some image you can use if you don't have Docker running. */}
26
25
{/* FUTURE CHANGE: Link to docs on alternative build/push options */}
Copy file name to clipboardExpand all lines: src/content/docs/sandbox/get-started.mdx
+63-71Lines changed: 63 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,9 @@ A simple API that can safely execute Python code and perform file operations in
19
19
20
20
### Ensure Docker is running locally
21
21
22
-
Sandbox SDK uses [Docker](https://www.docker.com/) to build container images alongside your Worker. Docker must be running when you deploy or run locally.
22
+
Sandbox SDK uses [Docker](https://www.docker.com/) to build container images alongside your Worker.
23
23
24
-
Install Docker by following the [Docker Desktop installation guide](https://docs.docker.com/desktop/).
25
-
26
-
Verify Docker is running:
27
-
28
-
```sh
29
-
docker info
30
-
```
31
-
32
-
If Docker is not running, this command will hang or return "Cannot connect to the Docker daemon".
24
+
<Renderproduct="containers"file="docker-setup" />
33
25
34
26
## 1. Create a new project
35
27
@@ -56,61 +48,58 @@ cd my-sandbox
56
48
The template provides a minimal Worker that demonstrates core sandbox capabilities:
-**containers** - Defines the [container image, instance type, and resource limits](/workers/wrangler/configuration/#containers) for your sandbox environment. If you expect to have multiple sandbox instances, you can increase `max_instances`.
192
+
-**durable_objects** - You need not be familiar with [Durable Objects](/durable-objects) to use Sandbox SDK, but if you'd like, you can [learn more about Cloudflare Containers and Durable Objects](/containers/get-started/#each-container-is-backed-by-its-own-durable-object). This configuration creates a [binding](/workers/runtime-apis/bindings#what-is-a-binding) that makes the `Sandbox`Durable Object accessible in your Worker code.
193
+
-**migrations** - Registers the `Sandbox` class, implemented by the Sandbox SDK, with [SQLite storage backend](/durable-objects/best-practices/access-durable-objects-storage) (required once)
202
194
203
195
For detailed configuration options including environment variables, secrets, and custom images, see the [Wrangler configuration reference](/sandbox/configuration/wrangler/).
Copy file name to clipboardExpand all lines: src/content/docs/sandbox/index.mdx
+48-22Lines changed: 48 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ df['sales'].sum() # Last expression is automatically returned
128
128
129
129
<Featureheader="Execute commands securely"href="/sandbox/guides/execute-commands/"cta="Learn about command execution">
130
130
131
-
Run shell commands, Python scripts, Node.js applications, and more in isolated containers with streaming output support and automatic timeout handling.
131
+
Run shell commands, Python scripts, Node.js applications, and more with streaming output support and automatic timeout handling.
132
132
133
133
</Feature>
134
134
@@ -144,6 +144,12 @@ Expose HTTP services running in your sandbox with automatically generated previe
144
144
145
145
</Feature>
146
146
147
+
<Featureheader="Execute code directly"href="/sandbox/guides/code-execution/"cta="Learn about code execution">
148
+
149
+
Execute Python and JavaScript code with rich outputs including charts, tables, and images. Maintain persistent state between executions for AI-generated code and interactive workflows.
150
+
151
+
</Feature>
152
+
147
153
---
148
154
149
155
## Use Cases
@@ -156,7 +162,7 @@ Execute code generated by Large Language Models safely and reliably. Perfect for
156
162
157
163
### Data Analysis & Notebooks
158
164
159
-
Create interactive data analysis environments with Python, pandas, and visualization libraries. Build notebook-like experiences at the edge.
165
+
Create interactive data analysis environments with pandas, NumPy, and Matplotlib. Generate charts, tables, and visualizations with automatic rich output formatting.
160
166
161
167
### Interactive Development Environments
162
168
@@ -194,35 +200,34 @@ Stateful coordination layer that enables Sandbox to maintain persistent environm
You must have Docker running locally when you run `wrangler deploy`. For most people, the best way to install Docker is to follow the [docs for installing Docker Desktop](https://docs.docker.com/desktop/). Other tools like [Colima](https://github.com/abiosoft/colima) may also work.
2
+
3
+
You can check that Docker is running properly by running the `docker info` command in your terminal. If Docker is running, the command will succeed. If Docker is not running,
4
+
the `docker info` command will hang or return an error including the message "Cannot connect to the Docker daemon".
0 commit comments