Public | Automated Build

Last pushed: 6 months ago
Short Description
Short description is empty for this repo.
Full Description

Keycloak MongoDB

Extends the Keycloak docker image to use MongoDB

Usage

Start a MongoDB instance

First start a MongoDB instance using the MongoDB docker image:

docker run --name mongo -e MONGODB_DBNAME=keycloak -d mongo

Start a Keycloak instance

Start a Keycloak instance and connect to the MongoDB instance:

docker run --name keycloak --link mongo:mongo jboss/keycloak-mongo

Environment variables

When starting the Keycloak instance you can pass a number of environment variables to configure how it connects to MongoDB. For example:

docker run --name keycloak --link mongo:mongo -e MONGODB_DBNAME=keycloak jboss/keycloak-mongo

MONGODB_DBNAME

Specify name of MongoDB database (optional, default is keycloak).

Docker Pull Command
Owner
jboss
Source Repository

Comments (2)
aritrachatterjee
8 months ago

The issue mentioned below seems like a defect in the image. Is there an estimate on the fix?

niggusch
9 months ago

12:00:22,362 INFO [org.jboss.as.server] (ServerService Thread Pool -- 47) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")
12:00:22,529 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: java.lang.IllegalStateException: WFLYCTL0056: Could not rename /opt/jboss/keycloak/standalone/configuration/standalone_xml_history/current to /opt/jboss/keycloak/standalone/configuration/standalone_xml_history/20161218-120022527
at org.jboss.as.controller.persistence.ConfigurationFile.createHistoryDirectory(ConfigurationFile.java:638)
at org.jboss.as.controller.persistence.ConfigurationFile.successfulBoot(ConfigurationFile.java:470)
at org.jboss.as.controller.persistence.BackupXmlConfigurationPersister.successfulBoot(BackupXmlConfigurationPersister.java:94)
at org.jboss.as.controller.AbstractControllerService.finishBoot(AbstractControllerService.java:449)
at org.jboss.as.server.ServerService.boot(ServerService.java:367)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
at java.lang.Thread.run(Thread.java:745)

12:00:22,533 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.

Can't get it work. Just did as described:
docker run --name mongo -e MONGODB_DBNAME=keycloak -d mongo

docker run --name keycloak --link mongo:mongo jboss/keycloak-mongo

What did I miss??