-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Create static/config.json from template file + ENV if not exist #511
Create static/config.json from template file + ENV if not exist #511
Conversation
Fixes DependencyTrack#60 Signed-off-by: Steffen Mueller <[email protected]>
@muellerst-hg Under what conditions exactly will |
@nscuro mount works well with docker 24.0.2 |
Thanks @muellerst-hg, I was able to reproduce with minikube start --kubernetes-version v1.27.2 --container-runtime containerd So it's a Containerd limitation. We now have two approaches that aim to fix this:
What would be the better approach? One thing that comes to mind for the |
Good catch regarding I would prefer a different approach: Solution: Build the image with |
Sounds like a sane approach to me. @Breee, WDYT? |
Yeah I agree. In addition I think that the frontend should not be broken, if there is no config, i.e. be able to handle an empty API_BASE_URL and inform that it is not configured. |
Signed-off-by: Steffen Mueller <[email protected]>
efaf591
to
73ebe9d
Compare
@nscuro updated the PR branch, PR title the description accordingly. Happy merge! |
Fixes #60
Description
static/config.json
can be set either from ENV variables or by mounting the file using a volume. docker-entrypoint.sh takes care of that. Current behavior was thatconfig.json
is used as is if the file is mounted , otherwise the file is populated with ENV variables.In some container environments,
mount
command is not feasible (e.g. kubernetes 1.27.2 / containerd 1.7.2) and entrypoint.sh fails.Currently,
static/config.json
is build into the image. However it just serves as a template, because it requires at least API_BASE_URL to be set. So instead of building an emptystatic/config.json
into the image, rather build the image withconfig.json.tmpl
Then check in docker-entrypoint if config.json file exists. If yes, then just leave it as it is. If not, create the file from config.json.tmpl and populate with ENV variables.Addressed Issue
fixes #60
Additional Details
Checklist