Skip to content

Commit f00c445

Browse files
committed
Merge remote-tracking branch 'origin/main' into base-image
2 parents 4cdbdbe + 73f06a3 commit f00c445

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+10928
-76
lines changed

.github/templates/pr-preview-comment.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### 🐳 Docker Images Published
22

3-
**Default (no Python):**
3+
**Default:**
44

55
```dockerfile
66
FROM {{DEFAULT_TAG}}
@@ -12,9 +12,15 @@ FROM {{DEFAULT_TAG}}
1212
FROM {{PYTHON_TAG}}
1313
```
1414

15+
**With OpenCode:**
16+
17+
```dockerfile
18+
FROM {{OPENCODE_TAG}}
19+
```
20+
1521
**Version:** `{{VERSION}}`
1622

17-
Use the `-python` variant if you need Python code execution.
23+
Use the `-python` variant if you need Python code execution, or `-opencode` for the variant with OpenCode AI coding agent pre-installed.
1824

1925
---
2026

.github/workflows/pkg-pr-new.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,22 @@ jobs:
109109
build-args: |
110110
SANDBOX_VERSION=${{ steps.package-version.outputs.version }}
111111
112+
- name: Build and push Docker image (opencode)
113+
uses: docker/build-push-action@v6
114+
with:
115+
context: .
116+
file: packages/sandbox/Dockerfile
117+
target: opencode
118+
platforms: linux/amd64
119+
push: true
120+
tags: cloudflare/sandbox:${{ steps.package-version.outputs.version }}-opencode
121+
cache-from: |
122+
type=gha,scope=preview-pr-${{ github.event.pull_request.number }}-opencode
123+
type=gha,scope=release-opencode
124+
cache-to: type=gha,mode=max,scope=preview-pr-${{ github.event.pull_request.number }}-opencode
125+
build-args: |
126+
SANDBOX_VERSION=${{ steps.package-version.outputs.version }}
127+
112128
- name: Extract standalone binary from Docker image
113129
run: |
114130
VERSION=${{ steps.package-version.outputs.version }}
@@ -136,13 +152,15 @@ jobs:
136152
const runId = '${{ github.run_id }}';
137153
const defaultTag = `cloudflare/sandbox:${version}`;
138154
const pythonTag = `cloudflare/sandbox:${version}-python`;
155+
const opencodeTag = `cloudflare/sandbox:${version}-opencode`;
139156
140157
const template = fs.readFileSync('.github/templates/pr-preview-comment.md', 'utf8');
141158
const body = template
142159
.replace(/\{\{VERSION\}\}/g, version)
143160
.replace(/\{\{RUN_ID\}\}/g, runId)
144161
.replace(/\{\{DEFAULT_TAG\}\}/g, defaultTag)
145-
.replace(/\{\{PYTHON_TAG\}\}/g, pythonTag);
162+
.replace(/\{\{PYTHON_TAG\}\}/g, pythonTag)
163+
.replace(/\{\{OPENCODE_TAG\}\}/g, opencodeTag);
146164
147165
// Find existing comment
148166
const { data: comments } = await github.rest.issues.listComments({

.github/workflows/pullrequest.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,18 @@ jobs:
116116
- name: Set up Docker Buildx
117117
uses: docker/setup-buildx-action@v3
118118

119-
- name: Build test worker Docker images (base + python)
119+
- name: Build test worker Docker images (base + python + opencode)
120120
run: |
121121
VERSION=${{ needs.unit-tests.outputs.version || '0.0.0' }}
122-
# Build base image (no Python) - used by SandboxBase binding
122+
# Build base image (no Python) - used by Sandbox binding
123123
docker build -f packages/sandbox/Dockerfile --target default --platform linux/amd64 \
124124
--build-arg SANDBOX_VERSION=$VERSION -t cloudflare/sandbox-test:$VERSION .
125-
# Build python image - used by Sandbox binding
125+
# Build python image - used by SandboxPython binding
126126
docker build -f packages/sandbox/Dockerfile --target python --platform linux/amd64 \
127127
--build-arg SANDBOX_VERSION=$VERSION -t cloudflare/sandbox-test:$VERSION-python .
128+
# Build opencode image - used by SandboxOpencode binding
129+
docker build -f packages/sandbox/Dockerfile --target opencode --platform linux/amd64 \
130+
--build-arg SANDBOX_VERSION=$VERSION -t cloudflare/sandbox-test:$VERSION-opencode .
128131
129132
# Deploy test worker using official Cloudflare action
130133
- name: Deploy test worker

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- name: Set up Docker Buildx
109109
uses: docker/setup-buildx-action@v3
110110

111-
- name: Build test worker Docker images (base + python)
111+
- name: Build test worker Docker images (base + python + opencode)
112112
run: |
113113
VERSION=${{ needs.unit-tests.outputs.version }}
114114
# Build base image (no Python) - used by Sandbox binding
@@ -117,6 +117,9 @@ jobs:
117117
# Build python image - used by SandboxPython binding
118118
docker build -f packages/sandbox/Dockerfile --target python --platform linux/amd64 \
119119
--build-arg SANDBOX_VERSION=$VERSION -t cloudflare/sandbox-test:$VERSION-python .
120+
# Build opencode image - used by SandboxOpencode binding
121+
docker build -f packages/sandbox/Dockerfile --target opencode --platform linux/amd64 \
122+
--build-arg SANDBOX_VERSION=$VERSION -t cloudflare/sandbox-test:$VERSION-opencode .
120123
121124
- name: Deploy test worker
122125
uses: cloudflare/wrangler-action@v3
@@ -213,6 +216,20 @@ jobs:
213216
build-args: |
214217
SANDBOX_VERSION=${{ needs.unit-tests.outputs.version }}
215218
219+
- name: Build and push Docker image (opencode)
220+
uses: docker/build-push-action@v6
221+
with:
222+
context: .
223+
file: packages/sandbox/Dockerfile
224+
target: opencode
225+
platforms: linux/amd64
226+
push: true
227+
tags: cloudflare/sandbox:${{ needs.unit-tests.outputs.version }}-opencode
228+
cache-from: type=gha,scope=release-opencode
229+
cache-to: type=gha,mode=max,scope=release-opencode
230+
build-args: |
231+
SANDBOX_VERSION=${{ needs.unit-tests.outputs.version }}
232+
216233
- name: Extract standalone binary from Docker image
217234
run: |
218235
VERSION=${{ needs.unit-tests.outputs.version }}

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ Turbo handles task orchestration (`turbo.json`) with dependency-aware builds.
291291

292292
**Subject line should stand alone** - don't require reading the body to understand the change. Body is optional and only needed for non-obvious context.
293293

294+
**Focus on the change, not how it was discovered** - never reference "review feedback", "PR comments", or "code review" in commit messages. Describe what the change does and why, not that someone asked for it.
295+
296+
**Avoid bullet points** - write prose, not lists. If you need bullets to explain a change, you're either committing too much at once or over-explaining implementation details. The body should be a brief paragraph, not a changelog.
297+
294298
Good examples:
295299

296300
```

examples/claude-code/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/cloudflare/sandbox:0.6.3
1+
FROM docker.io/cloudflare/sandbox:0.6.4
22
RUN npm install -g @anthropic-ai/claude-code
33
ENV COMMAND_TIMEOUT_MS=300000
44
EXPOSE 3000
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM docker.io/cloudflare/sandbox:0.6.3-python
1+
FROM docker.io/cloudflare/sandbox:0.6.4-python

examples/minimal/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/cloudflare/sandbox:0.6.3
1+
FROM docker.io/cloudflare/sandbox:0.6.4
22

33
# Required during local development to access exposed ports
44
EXPOSE 8080

examples/openai-agents/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/cloudflare/sandbox:0.6.3
1+
FROM docker.io/cloudflare/sandbox:0.6.4
22

33
# Required during local development to access exposed ports
44
EXPOSE 8080
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ANTHROPIC_API_KEY=<YOUR-KEY-HERE>

0 commit comments

Comments
 (0)