Differences between Keycloak and Keycloak X docker images

Hi Guys, I have this sample docker compose working fine:

version: '3.9'

volumes:
  db_data:
    driver: local

services:
  db:
    image: postgres:13-alpine
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}

  auth:
    image: quay.io/keycloak/keycloak:latest
    environment:
      DB_VENDOR: postgres
      DB_ADDR: db
      DB_DATABASE: ${POSTGRES_DB}
      DB_SCHEMA: public
      DB_USER: ${POSTGRES_USER}
      DB_PASSWORD: ${POSTGRES_PASSWORD}
      KEYCLOAK_USER: ${KEYCLOAK_USER}
      KEYCLOAK_PASSWORD: ${KEYCLOAK_PASSWORD}
      PROXY_ADDRESS_FORWARDING: "true"
    ports:
      - 8080:8080
    depends_on:
      - db

My problem appears when I try to use the Keycloak X image instead of the regular one. Changing only the line that defines de image, like this:

  auth:
    image: quay.io/keycloak/keycloak-x:latest

I start to face config/connection/env errors:

auth_1  | LogManager error of type WRITE_FAILURE: The delayed handler's queue was overrun and log record(s) were lost. Did you forget to configure logging?
auth_1  | 2021-06-07 17:00:01,605 WARN  [io.qua.agr.run.AgroalConnectionConfigurer] (main) Agroal does not support detecting if a connection is still usable after an exception for database kind: h2-file
auth_1  | 2021-06-07 17:00:03,869 ERROR [org.key.cli.Picocli] (main) ERROR: Failed to start server using profile (none).
auth_1  | 2021-06-07 17:00:03,871 ERROR [org.key.cli.Picocli] (main) ERROR: Key material not provided to setup HTTPS. Please configure your keys/certificates or enable HTTP or start the server using the 'dev' profile.
auth_1  | 2021-06-07 17:00:03,871 ERROR [org.key.cli.Picocli] (main) For more details run the same command passing the '--verbose' option. Also you can use '--help' to see the details about the usage of the particular command.

Do you guys can point any resource to where we can understand the differences between those releases?

To anyone interested, this is the solution I found:

  auth:
    image: quay.io/keycloak/keycloak-x:latest
    environment:
      DB: postgres
      DB_HOST: postgres
      DB_DATABASE: ${POSTGRES_DB}
      DB_SCHEMA: "public"
      DB_USER: ${POSTGRES_USER}
      DB_PASSWORD: ${POSTGRES_PASSWORD}
      KEYCLOAK_ADMIN: ${KEYCLOAK_USER}
      KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_PASSWORD}
      PROXY_ADDRESS_FORWARDING: "true"
    ports:
      - 8080:8080

The differences I found are:

DB => DB_VENDOR
DB_HOST => DB_ADDR
KEYCLOAK_ADMIN => KEYCLOAK_USER
KEYCLOAK_ADMIN_PASSWORD => KEYCLOAK_PASSWORD

I believe that this kind of change should be highlighted in documentation.

2 Likes

When running my own or your docker-compose example the keycloak-x container just prints the kc.sh help information. Is your docker-compose setup still working?

@Stokel, It seems version 16.0.1 has many changes related to commands and the way we need to pass the database variables values.
I was facing the same issue and then I tried to pass database-specific values with start-dev command using the command at the place of environment variables. “-Dkc.db.url.host” is also mandatory.
Working docker-compose code:

version: "3"

services:
  db:
    image: postgres:latest
    environment:
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password
    ports:
      - 5432:5432

  auth:
    image: quay.io/keycloak/keycloak-x:latest
    environment:
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: admin
      PROXY_ADDRESS_FORWARDING: "true"
    command: start-dev --db=postgres -Dkc.db.url.host=db --db-username=keycloak --db-password=password
    ports:
      - 8080:8080
    depends_on:
      - db

Great info, @atulchauhan01.

What about the non-dev scenario? What or how you pass those parameters to “prod” or “stable” envs?

@erickmoreno, I have not tried/explored the non-dev scenarios yet. Happy to hear from the community. :slight_smile:

@erickmoreno Did you able to run the non-dev scenario?