How can I use the `processes` section to avoid `CMD [""]` in my Dockerfile?

Hi :wave:

I have a working setup described in this public repo which lets me run Pi-hole at the edge (thanks to fly!) without exposing any port to the public internet (thanks to tailscale!). It works really well so far.

I’m just annoyed that I have to rely on a start script that (configures tailscale then) runs tail -f /dev/null; a silly hack that keeps the container alive.

Having looked at the new [processes] feature, I think there should be a way to remove the start script entirely and define a process instead to kickstart tailscale. Unfortunately I haven’t quite gotten it to work. Any pointers would be super appreciated! :pray:

I don’t really know much about the pihole setup, but the processes section is just defining the CMD used.

You can think processes as over-riding the CMD set in the Dockerfile.

In fact, it even will send the command to the configured ENTRYPOINT script (no surprise there, it’s the same behavior as Docker since that’s how Fly is setup to host apps).

1 Like

Thanks Chris! Thanks to your explanation and after looking more into the processes feature I actually don’t think it’s going to buy me much here.

Fly processes are meant to be long-lived, so I’m running into a similar situation described here, namely that I need to leave a long-lived process in the foreground. All the commands I need to run are one-off startup instructions that return immediately. I guess I’ll keep my silly tail -f /dev/null solution for now…