Skip to content

Conversation

@Pangjiping
Copy link
Collaborator

@Pangjiping Pangjiping commented Jan 26, 2026

Summary

  • Replace sh to bash under bootstrap
  • At the beginning we used sh for maximum compatibility, but I noticed that run_command in execd is still invoked via bash, so we’ve effectively been assuming that the user’s base image includes bash all along. Therefore I’m going to change the shebang in bootstrap.sh to bash as well, so we can use more modern syntax.

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script currently only uses POSIX-compliant syntax, so requiring bash for the script itself creates an unnecessary dependency that can prevent container startup on systems where /bin/bash is missing (e.g., Alpine uses /bin/sh).
Use sh shebang can at least let user start bootstrap successfully on system like Alpine, and we can prompt some bash missing error xxx message to the user to point to the real problem clearly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, execd's run_command API already depends on bash, so it can’t be used with images like Alpine anyway (and we also believe a bare Alpine environment isn’t representative of any real-world setup).

Changing the shebang to /bin/bash is essentially a way to “shift the error left”: rather than having execd fail at runtime, it’s better to fail early when the sandbox starts, with /bin/bash: No such file or directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants