# Prebuild Keycloak images for different database providers

**URL:** <https://forum.keycloak.org/t/prebuild-keycloak-images-for-different-database-providers/15279>\
**Category:** Configuring the server\
**Tags:** database\
**Created:** [April 29, 2022, 5:11pm UTC](https://forum.keycloak.org/t/prebuild-keycloak-images-for-different-database-providers/15279 "2022-04-29T17:11:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waterfront](https://avatars.discourse-cdn.com/v4/letter/w/c57346/32.png) [@Waterfront](https://forum.keycloak.org/u/Waterfront)\
**Post date:** [April 29, 2022, 5:11pm UTC](https://forum.keycloak.org/t/prebuild-keycloak-images-for-different-database-providers/15279/1 "2022-04-29T17:11:38Z")

</div>

I use Keycloak for private stuff, but want to run it in production mode (Docker).  
To minimize my maintenance efforts, I want to avoid the build step and directly use the quay image.

Looking into the documentation, it’s not possible because the default database provider of the docker image (I’m working with `18.0.0`) uses `dev-file` provider.  
To change it, I MUST use the build step, because the runtime variable `KC_DB` isn’t working:

> keycloak-new-keycloak-1 | 2022-04-29 17:08:57,415 WARN [io.quarkus.runtime.configuration.ConfigRecorder] (main) Build time property cannot be changed at runtime:  
> keycloak-new-keycloak-1 | - quarkus.datasource.jdbc.driver is set to ‘org.h2.jdbcx.JdbcDataSource’ but it is build time fixed to ‘org.mariadb.jdbc.MySQLDataSource’. Did you change the property quarkus.datasource.jdbc.driver after building the application?

Is there really no way around the build step, with using prod mode?  
Is there a plan to provide more keycloak image versions with other prebuild providers?

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [April 29, 2022, 5:18pm UTC](https://forum.keycloak.org/t/prebuild-keycloak-images-for-different-database-providers/15279/2 "2022-04-29T17:18:08Z")

</div>

Take a look at the `--auto-build` option. [Running Keycloak in a container - Keycloak](https://www.keycloak.org/server/containers#_use_auto_build_to_run_a_standard_keycloak_container)

---

<div class="post-metadata">

**Author:** ![Waterfront](https://avatars.discourse-cdn.com/v4/letter/w/c57346/32.png) [@Waterfront](https://forum.keycloak.org/u/Waterfront)\
**Post date:** [April 29, 2022, 6:50pm UTC](https://forum.keycloak.org/t/prebuild-keycloak-images-for-different-database-providers/15279/3 "2022-04-29T18:50:46Z")

</div>

Thank you, that’s a working solution 🙂
