Skip to content

Instantly share code, notes, and snippets.

@maslick
Last active January 28, 2016 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maslick/f8f9ee6f8c8fd3f2a0e1 to your computer and use it in GitHub Desktop.
Save maslick/f8f9ee6f8c8fd3f2a0e1 to your computer and use it in GitHub Desktop.
Wildfly 8.2.0 with keycloak adapter 1.3.1
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
RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#70365 --silent
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
@maslick
Copy link
Author

maslick commented Oct 14, 2015

to build the image run:

docker build -t wfly-kc-test .

to run a container:

docker run -d -p 8080:8080 -p 9990:9990 wfly-kc-test

@maslick
Copy link
Author

maslick commented Dec 7, 2015

In order to deploy services to the running Wildfly application server, add this to your project's pom.xml:

<build>
    <plugins>
        <!-- WildFly plugin to deploy war -->
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.0.2.Final</version>
            <configuration>
                <username>admin</username>
                <password>Admin#70365</password>
                <port>9990</port>
            </configuration>
        </plugin>
    </plugins>
</build>

then run:

mvn clean package wildfly:deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment