Skip to content

Commit 93c6cc7

Browse files
Fix CMD path to handle WORKDIR changes (#198)
Users extending the base Dockerfile with custom WORKDIR directives encountered container startup failures due to relative paths in both the startup script and CMD directive. Changed both to use absolute paths, making the container immune to WORKDIR changes in derived images.
1 parent 75de276 commit 93c6cc7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/fix-workdir-cmd-path.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudflare/sandbox': patch
3+
---
4+
5+
Fix container startup failures when WORKDIR is changed in derived Dockerfiles

packages/sandbox/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@ COPY packages/sandbox/startup.sh ./
187187
RUN chmod +x startup.sh
188188

189189
# Use startup script
190-
CMD ["./startup.sh"]
190+
CMD ["/container-server/startup.sh"]

packages/sandbox/startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
exec bun dist/index.js
3+
exec bun /container-server/dist/index.js

0 commit comments

Comments
 (0)