Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments are not passed to npm start script #581

Open
isibeni opened this issue Nov 11, 2024 · 1 comment · May be fixed by #584
Open

Arguments are not passed to npm start script #581

isibeni opened this issue Nov 11, 2024 · 1 comment · May be fixed by #584
Assignees

Comments

@isibeni
Copy link

isibeni commented Nov 11, 2024

When running a container with additional args those are ignored and not consumed by this buildpack

Expected Behavior

If an container is invoked with arguments I would expect that those are passed onto the start script.

Similar as it's today possible to pass in args when run npm run or npm start like this: npm start [-- <args>] .
When using the node-start buildpack it's also possible to pass in arguments

Current Behaviour

Arguments are ignored and not passed to the running process and can therefore not be consumed at all.

Possible Solution

Ensure that the start.sh is passing the argument to the start script. So when building the args in builder.go we would need to add an $@ for the start script to ensure it will be able to consume arguments

Steps to Reproduce

  1. Run a container build with this buildpack and pass in arguments.
  2. Within the started process log all arguments

Motivations

We are having a usecase where one builts an application with this buildpack and wants to start it with different configuration using arguments.

@c0d1ngm0nk3y
Copy link
Contributor

Note: The start.sh calls PreStart, Start and PostStart and we can just add $@ to the Start command.

@c0d1ngm0nk3y c0d1ngm0nk3y self-assigned this Nov 18, 2024
@c0d1ngm0nk3y c0d1ngm0nk3y linked a pull request Nov 18, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants