paketo-buildpacks / procfile

A buildpack for translating a Procfile into Process Types
Apache License 2.0
15 stars 11 forks source link

Error when using run image without `bash` #246

Closed c0d1ngm0nk3y closed 4 weeks ago

c0d1ngm0nk3y commented 1 month ago

Only for very specific stacks, the processes are started with direct: true which doesn't require a bash to be present.

If you use a run image for another stack, bash will be used.

Expected Behavior

It should work by calling the process directly.

Current Behavior

If no bash is present on the run image, you get the error

ERROR: failed to launch: bash exec: no such file or directory

Possible Solution

I see 2 possible solutions

  1. This is staight forward - just supprt BUILDPACK_API 0.9 like discussed in this issue. Then all processes would be started directly.

  2. Introduce an environment variable BP_DIRECT_PROCESS (defaults to false) which controls how to set direct.

Steps to Reproduce

Unfortunately, it is not possible to reproduce with paketo images since bionic.tiny and jammy.tiny are hardcoded to work. noble.tiny would be broken too, but unfortunately, there is no builder yet released with noble (why?).

But I created this simple nodejs based sample to reproduce.

Motivations

We want to use a minimal run image and not having a bash in there for no real reason.

modulo11 commented 1 month ago

This sounds like a reasonable workaround until the new libcnb version is out. @dmikusa wdyt?

loewenstein commented 1 month ago

This sounds like a reasonable workaround until the new libcnb version is out. @dmikusa wdyt?

I agree and would also appreciate taking this workaround in while we do not have a concrete upgrade plan to libcnb@v2. In particular, because even with a plan in place, we would probably still talk about weeks if not months until the procfile would be based on v2 and the problem be fixed. @paketo-buildpacks/utilities-maintainers WDYT?

dmikusa commented 1 month ago

It sounds good to me. I have a few minor notes about how we phrase this, but functionality is 👍.