Hello, everyone. It is typical to build Keycloak SPI during CI and copy the resultant SPI JAR files to the /opt/keycloak/providers/ folder using a Dockerfile where these instructions are present.
Sometimes, it is more convenient to disable a particular SPI entirely without commenting them in the Dockerfile and rebuilding the image from scratch.
Is it possible to do that using ENV variables or any other approach? We would appreciate any ideas.
Thanks for the reply.
Sorry I didn’t provide details. We want to disable some SPIs based on ENV variables without rebuilding Docker images.
We use an approach where “kc.sh build” is performed during Docker CI build based on Dockerfile command:
RUN ./bin/kc.sh build --cache=ispn --http-relative-path /auth --cache-stack=kubernetes --db=postgres …
And then, in our k8s manifest, we run Keycloak with /opt/keycloak/bin/kc.sh and args:
start
–optimized
Also, I know that we can perform Quarkus build during container starts, but it takes some additional time, thus looks not optimal from the performance point of view