Keycloak docker image for using with PostgreSQL over SSL/TLS.
8.5K
Keycloak docker image for using with PostgreSQL over SSL/TLS.
This image extends the original jboss/keycloak to allow specify abitrary parameters for a JDBC connection string. It is done by adding a few environment variables to standalone.xml and standalone-ha.xml configuration files.
MySQL is possible supported by the latest builds but not tested.
For full documentation refer to Keycloak's image page. Below will be described configuration of JDBC query parameters.
This repo will be maintained until Keycloak will not support abitrary JDBC parameters. There is a JIRA ticket for PostrgeSQL.
See a list of tags on Docker Hub.
upstream - alias for the master branch. It follows jboss/keycloak:latest and is automatically rebuilt, may be unstable.latest - alias for the stable branch with tagged Keycloak versions.This image introduces following environment variables:
KEYCLOAK_JDBC_PARAMS - JDBC parameters, it is applied to both PostreSQL and MySQL connection strings. Mainly it is for backward compatibility.POSTGRES_JDBC_PARAMS - parameters for PostreSQL connection string.MYSQL_JDBC_PARAMS - parameters for MySQL connection string.Example value of POSTGRES_JDBC_PARAMS is ssl=true&sslmode=verify-ca.
For all possible values refer to documentation of drivers:
PostgreSQL
PostgreSQL JDBC Driver
docker run --name keycloak-postgres-ssl -p 8080:8080 \
--link postgres-ssl:postgres \
-e KEYCLOAK_USER=admin \
-e KEYCLOAK_PASSWORD=admin \
-e POSTGRES_PORT_5432_TCP_ADDR=postgres \
-e POSTGRES_DATABASE=keycloak-db \
-e POSTGRES_USER=keycloak-user \
-e POSTGRES_PASSWORD=keycloak \
-e POSTGRES_JDBC_PARAMS='sslmode=verify-ca&sslrootcert=/opt/jboss/postgres.crt.der' \
-v ${CERTS_DIR}/postgres.crt.der:/opt/jboss/postgres.crt.der \
mnasyrov/keycloak-postgres-ssl:upstream
Docker files are located under ./src.
Build and test an image:
./scripts/build-image.sh
./scripts/test-image.sh
docker pull mnasyrov/keycloak-postgres-ssl:latest