Skip to content

Commit 3f71ec3

Browse files
committed
Move binary to /container-server/sandbox
1 parent 7408c07 commit 3f71ec3

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

.changeset/standalone-binary-arbitrary-dockerfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Users can now add sandbox capabilities to any Docker image:
99
```dockerfile
1010
FROM your-image:tag
1111

12-
COPY --from=cloudflare/sandbox:VERSION /sandbox /sandbox
12+
COPY --from=cloudflare/sandbox:VERSION /container-server/sandbox /sandbox
1313
ENTRYPOINT ["/sandbox"]
1414

1515
# Optional: run your own startup command

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Use the `-python` variant if you need Python code execution.
2323
**For arbitrary Dockerfiles:**
2424

2525
```dockerfile
26-
COPY --from={{DEFAULT_TAG}} /sandbox /sandbox
26+
COPY --from={{DEFAULT_TAG}} /container-server/sandbox /sandbox
2727
ENTRYPOINT ["/sandbox"]
2828
```
2929

@@ -36,5 +36,5 @@ gh run download {{RUN_ID}} -n sandbox-binary
3636
**Extract from Docker:**
3737

3838
```bash
39-
docker run --rm {{DEFAULT_TAG}} cat /sandbox > sandbox && chmod +x sandbox
39+
docker run --rm {{DEFAULT_TAG}} cat /container-server/sandbox > sandbox && chmod +x sandbox
4040
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
run: |
114114
VERSION=${{ steps.package-version.outputs.version }}
115115
CONTAINER_ID=$(docker create cloudflare/sandbox:$VERSION)
116-
docker cp $CONTAINER_ID:/sandbox ./sandbox-linux-x64
116+
docker cp $CONTAINER_ID:/container-server/sandbox ./sandbox-linux-x64
117117
docker rm $CONTAINER_ID
118118
chmod +x ./sandbox-linux-x64
119119

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,9 @@ jobs:
207207
- name: Extract standalone binary from Docker image
208208
run: |
209209
VERSION=${{ needs.unit-tests.outputs.version }}
210-
# Create container from the default image (has the binary at /sandbox)
211210
CONTAINER_ID=$(docker create cloudflare/sandbox:$VERSION)
212-
# Extract the binary
213-
docker cp $CONTAINER_ID:/sandbox ./sandbox-linux-x64
211+
docker cp $CONTAINER_ID:/container-server/sandbox ./sandbox-linux-x64
214212
docker rm $CONTAINER_ID
215-
# Verify the binary
216213
file ./sandbox-linux-x64
217214
ls -la ./sandbox-linux-x64
218215

packages/sandbox/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
119119
# Install Bun runtime from official image
120120
COPY --from=oven/bun:1 /usr/local/bin/bun /usr/local/bin/bun
121121

122-
# Copy standalone binary to root (for easy COPY --from in arbitrary Dockerfiles)
123-
COPY --from=builder /app/packages/sandbox-container/dist/sandbox /sandbox
122+
# Copy standalone binary
123+
COPY --from=builder /app/packages/sandbox-container/dist/sandbox /container-server/sandbox
124124

125125
# Set up container server directory for executors
126126
WORKDIR /container-server
@@ -147,7 +147,7 @@ ENV PYTHON_POOL_MIN_SIZE=0
147147
ENV JAVASCRIPT_POOL_MIN_SIZE=3
148148
ENV TYPESCRIPT_POOL_MIN_SIZE=3
149149

150-
ENTRYPOINT ["/sandbox"]
150+
ENTRYPOINT ["/container-server/sandbox"]
151151

152152
# ============================================================================
153153
# Stage 5b: Python image - full, with Python + data science packages
@@ -179,4 +179,4 @@ ENV PYTHON_POOL_MIN_SIZE=3
179179
ENV JAVASCRIPT_POOL_MIN_SIZE=3
180180
ENV TYPESCRIPT_POOL_MIN_SIZE=3
181181

182-
ENTRYPOINT ["/sandbox"]
182+
ENTRYPOINT ["/container-server/sandbox"]

0 commit comments

Comments
 (0)