Hi… The last time I tried a really stripped-down build, it turned out to be necessary to include a placebo /etc/passwd, which I think hallpass, the built-in SSH daemon, was using to determine which shell to run.
(And you would also need that /bin/bash or the like in your image, plus any helper utilities.)
Another possibility is to temporarily attach the volume to a more full-featured image. It’s counter-intuitive, but the Machines themselves are considered (mostly) disposable, . So, you would actually destroy the existing Machine, use fly m run --volume to get a temporary one, and then recreate the old Machine afterward.
These days, there’s also the possibility of a multi-container Machine. In your situation, that would mean that you would have a sidecar container which existed solely to be your Bash environment. Last I checked, all such containers had equal access to the persistent volume.
(And, of course, you could boot with and without that sidecar by tweaking fly.toml, as opposed to rebuilding the main image all the time.)
If you only need to write a config file, you can do this in the files key when you create a machine; see the docs here. I do this, and it works very well. I would be intrigued if this were to work with the update API; I can’t tell from the docs whether it is designed to.
Oh, super; thanks. Would you consider a docs update to make that clearer? I wonder if the “Machine config object properties” section would benefit from a single additional sentence saying that it can be used for both.
Error: an unhandled error occurred: ENOENT: No such file or directory
I was wondering if it was because the file was on the volume.
In the end I found it easier to detach the volume, create another machine, attach the volume, edit the config file, detach the volume and re-attach it.
If the volume is merely to support the creation/editing of this file, then perhaps you could always supply the file in your create and update calls, and the volume could be removed?