Hi… If you don’t need the interactive session at all, then you might like fly m run --rm for this.
For example…
$ time fly m run --rm --name ephemeral -a app-name debian:bullseye-slim -- sleep 60
real 0m7.000s
user 0m0.200s
sys 0m0.035s
$ fly m list
ID NAME STATE REGION
abcdef99543210 ephemeral started ord
(Still running!)
Hope this helps a little!
Aside: The double-hyphen before sleep isn’t strictly necessary here, but it’s a good reflex for the general case—when the command takes its own flags.
Awesome thank you! Does the machine inherit the app secrets? It would be awesome if you could add that, in my case for example I would have to hard code the secrets as —env in the command, which decreases security instead of increasing it