Docker entrypoint, read environment variables from files.#10918
Docker entrypoint, read environment variables from files.#10918epuronta wants to merge 0 commit intokeycloak:mainfrom
Conversation
|
I had no idea if and how the included test script should be run automatically. Might be appropriate. |
stianst
left a comment
There was a problem hiding this comment.
We should consider how reading secrets for things like DB aligns with reading secrets for things like LDAP server within a realm.
I can see that we should support something along the line of DB_USERNAME_FILE, but in that case it's something we would add to the Quarkus distribution to support somehow, and not as a wrapper in the container image.
|
Agreed @stianst, it would be better to have this directly where Quarkus loads the configuration instead of a wrapper script. I don't have the expertise to create a PR though, so someone else would need to step in for that. Also, sorry for the late response - I totally missed the reply notification here. |
Sorry if I'm missing something, but if you do an |
|
@artpdr as far as I understand, the primary security risk with having secrets in environment variables is related to how Docker displays the environment variables supplied to the container with The approach in this issue, however, exports the variables inside the container, so they are not exposed to docker (or at least not shown with For a simple example, fire up a container with one supplied secret and export another one from the inside Inspecting the container only exposes the first secret |
Adds a special entrypoint script for the Docker image.
The script supports using (mounted) files for configuring sensitive variables (like passwords). It is an alternative to passing the sensitive value directly as an environment variable (
KC_DB_PASSWORD=MyPassword).Basic process:
/tmp/kc-db-password)KC_DB_PASSWORD_FILE=/tmp/kc-db-password)KC_DB_PASSWORD_FILE, reads the file content and exports it asKC_DB_PASSWORDCloses #10816.