Replies: 3 comments 12 replies
-
We would probably want to think of way to generate it, so that it wouldn't have to be separately maintained. For example have the build command create one. Or are you thinking that the Keycloak project should provide both shell and shell-free base image? |
Beta Was this translation helpful? Give feedback.
-
|
Wouldn't this make it impossible to then provide CLI args to the KC instance? So I could not do something like: |
Beta Was this translation helpful? Give feedback.
-
|
I'll note that the current ubi-micro setup is already well hardened. Perhaps more hardened than many users would like. We chose back then to retain a minimal shell for keycloak's startup and also debugging ubi-micro is capable of going fully distroless while maintaining relevant metadata that is important for supply chain control and provenance. I would disagree with any move to vendored parent images like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think it's fair to say that there is general tendency toward more and more hardened and minimal runtime images. These intentionally avoid including components such as a shell, package manager, or other tools that are not required at runtime. Docker Hardened Images (DHI), for example, distinguish between runtime-focused and -dev variants for exactly this reason (btw, there is a variant of keycloak).
After studying how the current docker image is composed and wondering what it would take to run it on an even slimmer java runtime container - the current
kc.shentrypoint implies that a shell interpreter must be supplied. Essentially it prepears the final java command with required options. But I've also learned that since java 9 it's possible to supply those via an@argfilesyntax. And here is an example how the optimized image could be structured:and the
default.argsis basically a compilation of everything that kc.sh collects:Starting JVM this way technically saves ~100MB from the unpacked image, minus a few bash dependencies which otherwise would be a subject for vulnerability scanners.
Could it useful to bundle such args file into default keycloak builds?
Beta Was this translation helpful? Give feedback.
All reactions