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
Add documentation for lean and Python image variants introduced in
cloudflare/sandbox-sdk#259. This breaking change splits the base image
into two variants optimized for different workloads.
- Document default (lean) image without Python (~600-800MB)
- Document Python image with data science packages (~1.3GB)
- Add migration guide for users upgrading from 0.5.5 to 0.5.6+
- Document PYTHON_NOT_AVAILABLE error and how to resolve it
- Update all Dockerfile examples to use 0.5.6 versions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
// SandboxError: Python is not available in this container image.
51
+
// Use the cloudflare/sandbox:<version>-python image variant.
52
+
console.error(error.message);
53
+
}
54
+
```
55
+
</TypeScriptExample>
56
+
57
+
To fix this, update your Dockerfile to use the Python image variant. Refer to [Dockerfile reference](/sandbox/configuration/dockerfile/) for migration instructions.
58
+
:::
59
+
40
60
### `runCode()`
41
61
42
62
Execute code in a context and return the complete result.
Copy file name to clipboardExpand all lines: src/content/docs/sandbox/configuration/dockerfile.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The Sandbox SDK provides two image variants optimized for different use cases:
16
16
Optimized for shell commands and JavaScript/TypeScript execution (~600-800MB):
17
17
18
18
```dockerfile
19
-
FROM docker.io/cloudflare/sandbox:0.3.3
19
+
FROM docker.io/cloudflare/sandbox:0.5.6
20
20
```
21
21
22
22
**What's included:**
@@ -31,7 +31,7 @@ FROM docker.io/cloudflare/sandbox:0.3.3
31
31
Full image with Python and data science packages (~1.3GB):
32
32
33
33
```dockerfile
34
-
FROM docker.io/cloudflare/sandbox:0.3.3-python
34
+
FROM docker.io/cloudflare/sandbox:0.5.6-python
35
35
```
36
36
37
37
**What's included (in addition to default image):**
@@ -46,7 +46,7 @@ Using the lean image reduces image size by ~500MB and improves cold start times.
46
46
:::
47
47
48
48
:::caution[Version synchronization required]
49
-
Always match the Docker image version to your npm package version. If you're using `@cloudflare/sandbox@0.3.3`, use `docker.io/cloudflare/sandbox:0.3.3` (or `0.3.3-python`) as your base image.
49
+
Always match the Docker image version to your npm package version. If you're using `@cloudflare/sandbox@0.5.6`, use `docker.io/cloudflare/sandbox:0.5.6` (or `0.5.6-python`) as your base image.
50
50
51
51
**Why this matters**: The SDK automatically checks version compatibility on startup. Mismatched versions can cause features to break or behave unexpectedly. If versions don't match, you'll see warnings in your logs.
52
52
@@ -59,7 +59,7 @@ Create a `Dockerfile` in your project root:
59
59
60
60
```dockerfile title="Dockerfile"
61
61
# Use Python variant if you need Python packages
62
-
FROM docker.io/cloudflare/sandbox:0.3.3-python
62
+
FROM docker.io/cloudflare/sandbox:0.5.6-python
63
63
64
64
# Install additional Python packages
65
65
RUN pip install --no-cache-dir \
@@ -98,7 +98,7 @@ Run services automatically when the container starts by creating a custom startu
98
98
99
99
```dockerfile title="Dockerfile"
100
100
# Choose appropriate variant (default or -python)
101
-
FROM docker.io/cloudflare/sandbox:0.3.3
101
+
FROM docker.io/cloudflare/sandbox:0.5.6
102
102
103
103
COPY my-app.js /workspace/my-app.js
104
104
COPY startup.sh /workspace/startup.sh
@@ -146,7 +146,7 @@ If you attempt to execute Python code without the `-python` variant, you will re
146
146
147
147
## Related resources
148
148
149
-
-[Image Management](/containers/platform-details/image-management/) - Building and pushing images to Cloudflare\'s registry
149
+
-[Image Management](/containers/platform-details/image-management/) - Building and pushing images to Cloudflare's registry
150
150
-[Wrangler configuration](/sandbox/configuration/wrangler/) - Using custom images in wrangler.jsonc
0 commit comments