From afaa8c2db907b6ddaa34ceed52dee0b2b1cc6a79 Mon Sep 17 00:00:00 2001 From: "Erick G. Hagstrom" Date: Wed, 23 Aug 2023 03:19:22 -0400 Subject: [PATCH] Fix ambiguity about custom providers in containers.adoc (#22162) Amplified the explanation of how to include custom providers in a Dockerfile. Added code to provide context. Closes #22161 Co-authored-by: Erick G. Hagstrom --- docs/guides/server/containers.adoc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/guides/server/containers.adoc b/docs/guides/server/containers.adoc index d501448fcda..d7629193b83 100644 --- a/docs/guides/server/containers.adoc +++ b/docs/guides/server/containers.adoc @@ -54,12 +54,23 @@ The build process includes multiple stages: * In the final image, additional configuration options for the hostname and database are set so that you don't need to set them again when running the container. * In the entrypoint, the `kc.sh` enables access to all the distribution sub-commands. -To install custom providers, you just need to define a step to include the JAR file(s) into the `/opt/keycloak/providers` directory: +To install custom providers, you just need to define a step to include the JAR file(s) into the `/opt/keycloak/providers` directory. +This step must be placed before the line that `RUNs` the `build` command, as below: [source, dockerfile] ---- # A example build step that downloads a JAR file from a URL and adds it to the providers directory +FROM quay.io/keycloak/keycloak:latest as builder + +... + +# Add the provider JAR file to the providers directory ADD --chown=keycloak:keycloak /opt/keycloak/providers/myprovider.jar + +... + +# Context: RUN the build command +RUN /opt/keycloak/bin/kc.sh build ---- === Installing additional RPM packages