Skip to content

Commit 700c6ba

Browse files
Muhammad-Bin-AliMuhammad Ali
andauthored
Fix docs regarding custom Docker setup for sandboxes (#28602)
Co-authored-by: Muhammad Ali <muhammadali@cloudflare.com>
1 parent 6ec8f69 commit 700c6ba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/content/docs/sandbox/configuration/dockerfile.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ COPY my-app.js /workspace/my-app.js
137137
COPY startup.sh /workspace/startup.sh
138138
RUN chmod +x /workspace/startup.sh
139139

140-
ENTRYPOINT ["/sandbox"]
141140
CMD ["/workspace/startup.sh"]
142141
```
143142

143+
The base image already sets the correct `ENTRYPOINT`, so you only need to provide a `CMD`. The sandbox binary starts the HTTP API server, then spawns your `CMD` as a child process with proper signal forwarding.
144+
144145
```bash title="startup.sh"
145146
#!/bin/bash
146147

@@ -156,7 +157,7 @@ wait
156157
```
157158

158159
:::note[Legacy startup scripts]
159-
If you have existing startup scripts that end with `exec bun /container-server/dist/index.js`, they will continue to work for backwards compatibility. However, we recommend migrating to the new approach using `ENTRYPOINT ["/sandbox"]` with `CMD` for your startup script.
160+
If you have existing startup scripts that end with `exec bun /container-server/dist/index.js`, they will continue to work for backwards compatibility. However, we recommend migrating to the new approach using `CMD` for your startup script. Do not override `ENTRYPOINT` when extending the base image.
160161
:::
161162

162163
## Related resources

0 commit comments

Comments
 (0)