title: Keycloak fails to import exported realm running in docker
body: <p>I started my keycloak service using the command: </p>
  
  <pre><code>docker run -d -p 8180:8080 -e KEYCLOAK_USER=admin -e \
  KEYCLOAK_PASSWORD=admin -v $(pwd):/tmp --name kc \
  jboss/keycloak:8.0.2
  </code></pre>
  
  <p>I created a new realm on keycloak only giving it a name, nothing else. Exported it running the command:</p>
  
  <pre><code>docker exec -it kc keycloak/bin/standalone.sh \
  -Djboss.socket.binding.port-offset=100 -Dkeycloak.migration.action=export \
  -Dkeycloak.migration.provider=singleFile \
  -Dkeycloak.migration.realmName=my_realm \
  -Dkeycloak.migration.usersExportStrategy=REALM_FILE \
  -Dkeycloak.migration.file=/tmp/my_realm.json
  </code></pre>
  
  <p>I now have the realm in the my_realm.json file. I then start a new keycloak using docker compose to set up my entire test environment. I build a new docker image with the this DockerFile:</p>
  
  <pre><code>FROM jboss/keycloak:8.0.2
  
  COPY my_realm.json /tmp/my_realm.json
  
  ENV KEYCLOAK_IMPORT /tmp/my_realm.json
  ENV KEYCLOAK_MIGRATION_STRATEGY OVERWRITE_EXISTING
  </code></pre>
  
  <p>Docker compose:</p>
  
  <pre><code>version: '3.4'
  volumes:
    postgres_kc_data:
      driver: local
  services:
    kc_postgresql:
      image: postgres:11.5
      volumes:
        - postgres_kc_data:/var/lib/postgresql/data
      environment:
        POSTGRES_PASSWORD: kc
        POSTGRES_USER: kc
        POSTGRES_DB: kcdb
      ports:
        - 50009:5432
    keycloak:
      build: "./keycloak/" # ref to folder with above DockerFile
      environment:
        KEYCLOAK_USER: admin
        KEYCLOAK_PASSWORD: admin
        DB_VENDOR: POSTGRES
        DB_ADDR: kc_postgresql
        DB_DATABASE: kcdb
        DB_SCHEMA: public
        DB_USER: kc
        DB_PASSWORD: kc
      depends_on:
        - kc_postgresql
      ports:
      - 8080:8080
  </code></pre>
  
  <p>The log output from running docker compose indicates that it is not able to import realm, and suggests something about validating the clients. I added no clients, so these are the default ones.</p>
  
  <pre><code>08:39:46,713 WARN  [org.keycloak.services] (ServerService Thread Pool -- 67) KC-SERVICES0005: Unable to import realm Demo from file /tmp/my_realm.json.: java.lang.NullPointerException
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.url.DefaultHostnameProvider.resolveUri(DefaultHostnameProvider.java:83)
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.url.DefaultHostnameProvider.getScheme(DefaultHostnameProvider.java:38)
      at org.keycloak.keycloak-server-spi@8.0.2//org.keycloak.models.KeycloakUriInfo.&lt;init&gt;(KeycloakUriInfo.java:46)
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.services.DefaultKeycloakContext.getUri(DefaultKeycloakContext.java:79)
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.services.util.ResolveRelative.resolveRootUrl(ResolveRelative.java:45)
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.validation.DefaultClientValidationProvider.validate(DefaultClientValidationProvider.java:44)
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.validation.DefaultClientValidationProvider.validate(DefaultClientValidationProvider.java:37)
      at org.keycloak.keycloak-server-spi-private@8.0.2//org.keycloak.validation.ClientValidationUtil.validate(ClientValidationUtil.java:30)
      at org.keycloak.keycloak-server-spi-private@8.0.2//org.keycloak.models.utils.RepresentationToModel.createClients(RepresentationToModel.java:1224)
      at org.keycloak.keycloak-server-spi-private@8.0.2//org.keycloak.models.utils.RepresentationToModel.importRealm(RepresentationToModel.java:362)
      at org.keycloak.keycloak-services@8.0.2//org.keycloak.services.managers.RealmManager.importRealm(RealmManager.java:506)
  
  </code></pre>
  
  <p>Any pointers are welcome!</p>