I am trying to edit the standalone.xml through docker and trying to add but the keycloak is taking its standalone.xml
. But I am able to see the changes inside the standalone.xml file. I need to add this line in standalone.xml file
<provider>module:org.keycloak.examples.event-sysout</provider>
Also tried hot deployement but then can't fetch third party libraries code
xml is used. You can find this in /opt/jboss/tools/docker-entrypoint.sh.
By default, Keycloak is available on http://127.0.0.1:8080/ and https://127.0.0.1:8443/.
First, it seems in a docker container by default standalone-ha.xml is used. You can find this in /opt/jboss/tools/docker-entrypoint.sh. Second, I think after changing configuration file you'll have to restart keycloak server (container).
Not sure what do you mean by "dynamically". But it will be easier to modify the file locally and build a custom docker image. Dockerfile may look like:
FROM jboss/keycloak:6.0.1
ADD <path on your system>/standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml
You can not replace or overwrite standalone-ha.xml/standalone.xml without jboss-cli on docker image. Only need to create a sh file and put inside startup-script folder. During initializing it will start and configure your file.
keycloak-cli
embed-server --server-config=standalone-ha.xml --std-out=echo
batch
/subsystem=keycloak-server:list-add(name=providers, value=module:org.keycloak.examples.event-sysout)
run-batch
stop-embedded-server
Dockerfile
FROM jboss/keycloak:latest
COPY keycloak.cli /opt/jboss/startup-scripts/keycloak.cli
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With