Keycloak Docker image to use with an external Oracle database (Extends the Keycloak docker image).
- Oracle 11 DB installed and running.
- Download and copy the oracle 'ojdbc6.jar' driver and locate it in the root directory beside the dockerfile.
- A local docker registry installed and running on port 5000.
- docker network configured to access with the name oracle-db to the oracle db server (you can install or use rancher to achieve that)
docker build -t jboss/keycloak-oracle .
docker tag jboss/keycloak-oracle localhost:5000/keycloak-oracle .
docker push localhost:5000/keycloak-oracle
Start a Keycloak instance and connect to the ORACLE instance:
docker run --name keycloak --link oracle-db:oracle-db -e ORACLE_TCP_ADDR=kcdbaddr localhost:5000/keycloak-oracle
When starting the Keycloak instance you can pass a number of environment variables to configure how it connects to ORACLE. For example:
docker run --name keycloak --link oracle-db:oracle-db -e ORACLE_TCP_ADDR=kcdbaddr -e ORACLE_DATABASE=kcdb -e ORACLE_USER=kcuser -e ORACLE_PASSWORD=kcpassword localhost:5000/keycloak-oracle
Specify name of ORACLE database (optional, default is keycloak
).
Specify address for ORACLE database (required).
Specify port for ORACLE database (optional, default is 1521
).
Specify user for ORACLE database (optional, default is keycloak
).
Specify password for ORACLE database (optional, default is password
).