Keycloak.X Docker DB setup: "No suitable driver found"

When trying to launch the Keycloak.X Docker image, I get the following error:
java.sql.SQLException: No suitable driver found for jdbc:mariadb://

Here is how I’m launching the container:

docker run -e KEYCLOAK_ADMIN=<username> -e KEYCLOAK_ADMIN_PASSWORD=<password> \
  -ti -p 80:8080 \
  -Dkc.db=mariadb<db-ip> \
  --db-username=<db-username> --db-password=<db-password> --http-enabled=true

I’ve also tried using the --db-url parameter as well as different DB vendor strings. All of them result in the same error. What’s strange is that when running the container with the internal H2 DB, I see the following in the logs:

Installed features: [agroal, cdi, hibernate-orm, jdbc-h2, jdbc-mariadb, jdbc-mysql, jdbc-postgresql, keycloak, mutiny, narayana-jta, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, smallrye-metrics, vertx, vertx-web]

So, the JDBC drivers should be there according to the logs. What am I doing wrong?

The db config parameter is a build time config parameter. So, first build your custom image with the parameter and the command build, or start the container with the command auto-build.

Keep in mind that Keycloak.X is still preview, so not all docs are final and/or official, nor publicly available. However, it‘s mentioned somewhere already. Once X is officially supported, also the docs will be updated and available.

Perfect! It looks like that actually needs to be passed with the config command - build throws an error that the command build doesn’t exist. However, I’ve got it working now. Thanks!