If use a Procfile to declare a complex command, I would expect that the first token would be the command and the rest be arguments. This would allow me to define default behaviour, but then allow me to customise arguments in later invocations.
However, it appears that there is no tokenization of the commands in entrypoint parsing.
Testing a single command as the process definition:
web: ./app.py
$ pack build single --path .
...
$ docker run single
Invocation: ./app.py (len = 1)
$ docker run single more args
Invocation: ./app.py, more, args (len = 3)
$ pack inspect single
Processes:
TYPE SHELL COMMAND ARGS
web (default) bash ./app.py
But changing this process entrypoint to something more complex:
web: python app.py
$ pack build single --path .
...
$ docker run double
Invocation: app.py (len = 1)
python app.py: python app.py: command not found
$ pack inspect double
Processes:
TYPE SHELL COMMAND ARGS
web (default) bash python app.py
I know I can use the launcher entrypoint to define a completely new set of command and args, but I'd rather be able to just append args to my invocation.
(I'm currently encountering this using google cloud buildpack images in Cloud Build steps, but also (yet to confirm) Cloud Run jobs)
Describe the bug
If use a
Procfile
to declare a complex command, I would expect that the first token would be the command and the rest be arguments. This would allow me to define default behaviour, but then allow me to customise arguments in later invocations.However, it appears that there is no tokenization of the commands in entrypoint parsing.
Example:
app.py (chmod +x):
Testing a single command as the process definition:
But changing this process entrypoint to something more complex:
I know I can use the
launcher
entrypoint to define a completely new set of command and args, but I'd rather be able to just append args to my invocation.(I'm currently encountering this using google cloud buildpack images in Cloud Build steps, but also (yet to confirm) Cloud Run jobs)
From current codebase:
https://github.com/GoogleCloudPlatform/buildpacks/blob/main/cmd/config/entrypoint/main_test.go#L90 implies the process is parsed into just a command
https://github.com/GoogleCloudPlatform/buildpacks/blob/main/pkg/gcpbuildpack/gcpbuildpack_test.go#L329 implies the process is separated into 1 command and N arguments
Additional context
How are you using GCP buildpacks?
pack
and thegcr.io/buildpacks/builder
pack build --workspace /app
(additional bug))What language is your project primarily written in?
Python