/bin/sh built-in to init

I like building minimal containers with just the target binary in them. When I try to connect to one of these minimal containers with fly ssh console, it exits immediately. My app logs show that some Fly process tries to fork/exec /bin/sh but fails because its not found. Would you guys be able to bundle a busybox or just /bin/sh inside the init process itself for such a scenario?

We used to have busybox bundled for its ip facilities, but we ended up just using netlink directly from the init.

Minimal containers are fun, but if you do need to SSH in there, I’d recommend a putting busybox in there or sh. You can also specify any command to run with fly ssh console -C <command>.

Eventually, I’d like to have everything bundled in the init. Right now the SSH server is a go binary we compile and include in the initrd. It could just be in Rust. Perhaps there’s a good solution for an embedded shell in Rust too.

Ah makes sense. I recently pulled out busybox from an app that was doing netlink stuff as well. Was so much cleaner using netlink instead of shelling out. I also find the thought of init containing all the Fly services appealing. For now, I’ll include a static sh in my builds if I really need it.

1 Like

Thinking about it: you’ll see be out of luck with just sh. You’ll probably need cat, ls, etc. :slight_smile:

Yeah I’ll probably do a static busybox!