keycloak: Can't see the admin console

Describe the bug

I’m using a Dockerfile for create a custom image of Keycloak as follows:

FROM quay.io/keycloak/keycloak:18.0.2 as builder

ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_DB=postgres
# Install custom providers
RUN curl -sL https://github.com/aerogear/keycloak-metrics-spi/releases/download/2.5.3/keycloak-metrics-spi-2.5.3.jar -o /opt/keycloak/providers/keycloak-metrics-spi-2.5.3.jar
RUN /opt/keycloak/bin/kc.sh build

FROM quay.io/keycloak/keycloak:18.0.2
COPY --from=builder /opt/keycloak/ /opt/keycloak/
WORKDIR /opt/keycloak
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]

and whit this docker-compose I am able to run Keycloak:

version: "3.9"
services:

  keycloak_db:
    image: postgres
    environment:
      - POSTGRES_USER=$DB_USER
      - POSTGRES_PASSWORD=$DB_PASS
      - POSTGRES_DB=$DB_NAME
      - IGNORE_INIT_HOOK_LOCKFILE=true
    volumes:
      - ./db/:/docker-entrypoint-initdb.d/
    ports:
      - ${DB_EXTERNAL_PORT:-15432}:5432

  keycloak:
    container_name: keycloak
    # image: quay.io/keycloak/keycloak:18.0.1
    image: keycloak
    ports:
      - "${KEYCLOAK_EXTERNAL_PORT:-18180}:8080"
    environment:
      - KEYCLOAK_ADMIN=${KEYCLOAK_USER}
      - KEYCLOAK_ADMIN_PASSWORD=${KEYCLOAK_PASSWORD}
      - KC_DB=postgres
      - KC_DB_URL_HOST=$DB_HOST
      - KC_DB_URL_PORT=5432
      - KC_DB_URL_DATABASE=$DB_NAME
      - KC_DB_SCHEMA=$KEYCLOAK_SCHEMA
      - KC_DB_USERNAME=$DB_USER
      - KC_DB_PASSWORD=$DB_PASS
      - KC_HTTP_ENABLED=true
      - KC_HOSTNAME=localhost
      - KC_HOSTNAME_ADMIN=localhost
      - KC_HOSTNAME_PORT=80
      - KC_HOSTNAME_STRICT_BACKCHANNEL=true
      - KC_HOSTNAME_STRICT_HTTPS=false
      - KC_PROXY=edge
      - KC_PROXY_ADDRESS_FORWARDING=true
      - KC_KEYCLOAK_FRONTEND_URL=http://localhost:18180/
      - KC_KEYCLOAK_URL=http://localhost:18180/
      # - KC_LOG_LEVEL=debug
    depends_on:
      - keycloak_db

I can see the Keycloak homepage: enter image description here

But when I try to go to the admnistration console I see a blank page: enter image description here

And if I use KC_FEATURES=admin2 as further environment variable I can see something, but still not the admin console:

enter image description here

Version

18.0.2

Expected behavior

See the admin console

Actual behavior

Can’t see the admin console

How to Reproduce?

No response

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 20 (3 by maintainers)

Most upvoted comments

If I use ENV KC_FEATURES=token-exchange in Dockerfile for the builder I can see the login page: Screenshot from 2022-06-25 19-17-33

But, after the login, always a blank page: Screenshot from 2022-06-25 19-18-17