Public | Automated Build

Last pushed: 12 days ago
Short Description
Short description is empty for this repo.
Full Description

Keycloak Wildfly Adapter

This image contains Wildfly with the required bits to deploy an application that would be protected by the Keycloak subsystem, including:

  • Keycloak Wildfly Extension
  • Keycloak Wildfly Subsystem
  • Changes to the standalone.xml , to include both the extension and the subsystem, as well as the security-domain for Keycloak.

Usage

To boot in standalone mode

docker run jboss/keycloak-adapter-wildfly

Other details

This image is intended to be extended by you, to include your application to it. Without it, this image is just a Wildfly image with an extra sauce.

Note that only the standalone mode is configured. If your application needs to work on domain mode as well, changes to the domain.xml similar to the ones applies to the standalone are required.

Docker Pull Command
Owner
jboss
Source Repository

Comments (2)
maslick
2 years ago

This resolves the issue:

FROM jboss/wildfly:8.2.0.Final

ENV KEYCLOAK_VERSION 1.3.1.Final

WORKDIR /opt/jboss/wildfly

RUN curl -L https://sourceforge.net/projects/keycloak/files/$KEYCLOAK_VERSION/adapters/keycloak-wf8-adapter-dist-$KEYCLOAK_VERSION.tar.gz | tar zx

WORKDIR /opt/jboss

# Standalone.xml modifications.
RUN sed -i -e 's/<extensions>/&\n        <extension module="org.keycloak.keycloak-adapter-subsystem"\/>/' $JBOSS_HOME/standalone/configuration/standalone.xml && \
    sed -i -e 's/<profile>/&\n        <subsystem xmlns="urn:jboss:domain:keycloak:1.1"\/>/' $JBOSS_HOME/standalone/configuration/standalone.xml && \
    sed -i -e 's/<security-domains>/&\n                <security-domain name="keycloak">\n                    <authentication>\n                        <login-module code="org.keycloak.adapters.jboss.KeycloakLoginModule" flag="required"\/>\n                    <\/authentication>\n                <\/security-domain>/' $JBOSS_HOME/standalone/configuration/standalone.xml
maslick
2 years ago

Version 1.3.1.Final fails to start:

$ docker run jboss/keycloak-adapter-wildfly:1.3.1.Final
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /opt/jboss/wildfly

  JAVA: /usr/lib/jvm/java/bin/java

  JAVA_OPTS:  -server -XX:+UseCompressedOops  -server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
13:39:54,725 INFO  [org.jboss.modules] (main) JBoss Modules version 1.4.3.Final
13:39:55,283 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
13:39:55,391 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 9.0.0.Final (WildFly Core 1.0.0.Final) starting
13:39:56,104 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.server.ServerService.boot(ServerService.java:350) [wildfly-server-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module org.keycloak.keycloak-subsystem
    at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:155) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:433) [wildfly-server-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144) [wildfly-server-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106) [wildfly-server-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.2.0.Final.jar:1.2.0.Final]
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.2.0.Final.jar:1.2.0.Final]
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    ... 3 more
Caused by: java.util.concurrent.ExecutionException: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) [rt.jar:1.8.0_45]
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) [rt.jar:1.8.0_45]
    at org.jboss.as.controller.parsing.ExtensionXml.parseExtensions(ExtensionXml.java:147) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    ... 9 more
Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module
    at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:196) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.controller.parsing.ExtensionXml.access$000(ExtensionXml.java:69) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:127) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.controller.parsing.ExtensionXml$1.call(ExtensionXml.java:124) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
    at org.jboss.threads.JBossThread.run(JBossThread.java:320) [jboss-threads-2.2.0.Final.jar:2.2.0.Final]
Caused by: org.jboss.modules.ModuleNotFoundException: org.keycloak.keycloak-subsystem:main
    at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:236) [jboss-modules.jar:1.4.3.Final]
    at org.jboss.as.controller.parsing.ExtensionXml.loadModule(ExtensionXml.java:178) [wildfly-controller-1.0.0.Final.jar:1.0.0.Final]
    ... 8 more

13:39:56,221 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
13:39:56,321 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested.
13:39:56,507 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0050: WildFly Full 9.0.0.Final (WildFly Core 1.0.0.Final) stopped in 102ms