HUB
Sign inSign up

mnasyrov/keycloak-postgres-ssl

By mnasyrov

•Updated about 8 years ago

Keycloak docker image for using with PostgreSQL over SSL/TLS.

Image
1

8.5K

mnasyrov/keycloak-postgres-ssl repository overview

⁠keycloak-postgres-ssl

Keycloak docker image for using with PostgreSQL over SSL/TLS.

Build Status

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.

⁠Supported tags

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.

⁠Configuration

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:

⁠Other useful docs

PostgreSQL

PostgreSQL JDBC Driver

⁠Usage example
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

⁠Development

Docker files are located under ./src.

Build and test an image:

./scripts/build-image.sh
./scripts/test-image.sh
Tag summary
Recent tags
Content type
Image
Digest
Size
348.6 MB
Last updated
about 8 years ago
docker pull mnasyrov/keycloak-postgres-ssl:latest