Export CLI args as ENV variables in Docker container #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I've noticed that executable flags does not seem to work properly in the container deployment. Running the image with the following steps described in the documentation works perfectly:
Still, when running the same command with passing args, it fails. I get the following error:
This applies to any flag that we try to startup the container. My understanding is that in the
Dockerfile
, theENV
variables are exported and passed to theCMD
. With this approach I believe that we are unable to use theENV
variables and CLI flags from the binary as well. Please advise if I'm doing something wrong :).In some Kubernetes deployments, it is useful to change the default metrics path/exposed ports. Not having the possibility to set these CLI args is problematic in some deployments.
I've made a change in this fork so that you can have a look. This approach works in my deployment and ensures no breaking changes by following the same logic.
Is there any other recommended way to use the CLI flags and the ENV variables with the current image? If not, do you think this could be updated in the docker image?
Thank you in advance.
Cheers!