Dockerfile’s ENTRYOINT
or CMD
needs to exec a process forever (shouldn’t just quit, save for errors, interrupts). If it doesn’t, then Fly’s init
process that drives the Firecracker-managed VM will quit, too.
All of them address the first rule of programs running in Fly.app: when your entrypoint program exits, our
init
kills the VM and we start a new one. So at the end of the day, something has to keep running “in the foreground”.
From: Running Multiple Processes Inside A Fly.io App · Fly Docs
Ref: docker is exited immediately when runs with error code 139 - Stack Overflow