Passing CLI args to start command
battlesquid
HOBBYOP

2 years ago

I'm currently trying to create a template, and I want to pass env vars as arguments to the start command. Is there a way to do this? From my initial research, it seems not since custom start commands are run using exec mode, but I might be overlooking something.

7 Replies

battlesquid
HOBBYOP

2 years ago

75e3b346-93c5-4759-b0c7-991c535ad323


2 years ago

you are correct, they are running in exec mode when using an image or Dockerfile, the solution is to wrap the command in a shell that contains exec again -

/bin/sh -c "exec server -h 0.0.0.0 -p $PORT"

this string will be interpolated and then exec will replace the original shell and run the command with the now interpolated variables


battlesquid
HOBBYOP

2 years ago

Sorry for the late response, this worked, thank you


battlesquid
HOBBYOP

2 years ago

Only issue is that now I'm into the networking issues I described in the other post


battlesquid
HOBBYOP

2 years ago

Edge works, chrome doesn't, i get "Application failed to respond"


battlesquid
HOBBYOP

2 years ago

At a loss for what the issue could be


2 years ago

lets go back to that thread?


Loading...