That’s a weird one, usually you see that when wanting an amd64 container but running on a arm64 machine (or visa-versa). Is that error message cut off at all? Or is actual: linux the whole thing?
I wonder if max depth exceeded is the true issue tho, that sometimes happens with some unintended recursion (you usually see it when docker-compose.yml is used and tries to name a built image to the same name of an existing image on docker hub). Perhaps your fly.toml config is off.
A note to Fly.io staff: I wonder how many Fly.io customers are struggling with PHP buildpack quirks, and if a simpler-to-Dockerize way of running a web server with PHP, such as FrankenPHP (docker docs) would be a better default recommendation. I think that would make for a good blog post on Laravel Bytes if you have anyone available to write up the details such as how to best configure the Caddyfile, etc. Just my 2 cents.
Are you deploying a Laravel app or something else?
We have a lot of tooling around Laravel that can be re-used for other PHP apps, which creates a Dockerfile rather than using a buildpack.
One “hack” to see this is to create an empty artisan file, and running fly launch to see the Dockerfile (etc) that it creates. You might want to do this in a separate branch of your code so you don’t mess up the current (working?) configuration.
You’ll end up (I believe) with a Dockerfile and some files in a .fly directory. It assumes the web root is /var/www/html/public. It also may attempt to run some artisan commands (specific to Laravel) that you can remove in the .fly/scripts directory, and in 2 spots in the generated Dockerfile.