This repository contains the necessary files to build a custom Keycloak Docker image, incorporating custom Service Provider Interfaces (SPIs) and themes. Our project leverages Docker's multistage build feature to create a lean and secure Keycloak image tailored to our specific needs.
Our custom Keycloak image is designed to extend the functionality of Keycloak by adding custom SPI implementations and a unique theme that enhances the user interface. This project is inspired by the Keycloak User Storage SPI Quickstart and follows the guidelines for creating custom themes in Keycloak.
Before you begin, ensure you have the following installed on your system:
- Docker
- Git (for cloning this repository)
To get started with this project, follow these steps:
- Clone the Repository
git clone https://github.com/open200/keycloak-blog
cd keycloak-blog- Build the Docker Image
docker build -t keycloak-blog .- Run the Docker Container
docker run -p 8080:8080 \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=admin \
-v ./volume:/opt/keycloak/properties \
keycloak-blog:latest \
start-devAfter running these commands, Keycloak will be accessible at http://localhost:8080.
You can log in using the admin credentials provided in the run command.
This project includes an example SPI implementation and a custom theme. The SPI is based on the readonly-property-file provider, allowing authentication against a predefined set of users. The custom theme modifies the appearance of the Keycloak login page.
For an in-depth explanation of how we built this custom Keycloak Docker image, including the rationale behind using Docker's multistage build feature, the process of incorporating custom SPIs and themes, and a step-by-step guide through the Dockerfile, check out our blog post: "Leveraging Docker Multistage Builds for Custom Keycloak SPIs". This post provides valuable insights into the project's background, the challenges we faced, and how we overcame them to create a lean and secure Keycloak image tailored to our specific needs.
This project is licensed under the MIT License - see the LICENSE file for details.