Before I get into the meat of things, I want to give a brief overview of the differences between the apps platform (what you get with deploy) vs standalone machines (what you get with fly m [command]) You probably already know this! I just wanted to make sure we’re on the same page.
fly deploy and fly m run are pretty different - deploy is for the apps platform, which means it’s intended for an app where all of your machines run the same image and (usually) expose the same service. fly m run is for machines, which is the building block for the apps platform, but a little bit lower level. There’s no fly.toml, for example, with just machines. The toml file is a description of an apps platform app, but fly m run sits at a level of abstraction below that.
Essentially, deploy/launch/fly apps [x] is for application hosting, and fly machine [x] is for VMs as a service.
With that out of the way:
there’s no easy way to get something from fly.toml into a standalone machine.
If you’re determined to use fly m run, you can pass -e ENVVAR=someval -e OTHERENV=newvalue to pass values to your machine.
Alternatively, you could just use fly deploy without --build-only --push, which would create machines as part of the apps platform, and sidestep the issue entirely.
As for fly m run complaining about -a, -r, and --name, that’s very strange. Do you happen to still have the console output logs for this? that’s definitely not right.