Skip to content

Import a keycloak Realm with docker on Windows 10

Open a Cygwin bash

  • Just type bash on your windows CMD

Prepare import Script location

 $ dir d:/dev/quarkus/security-keycloak-authorization-quickstart/import
  realm-export.json

$ ls -l d:/dev/quarkus/security-keycloak-authorization-quickstart/import
  -rw-r--r-- 1 Helmut None 75534 Jan 22 11:38 realm-export.json

Run import

  • Share Windows folder by : -v “d:/dev/quarkus/security-keycloak-authorization-quickstart/import:/opt/jboss/keycloak/imports”
  • Add -Dkeycloak.profile.feature.upload_scripts=enabled” to your KEYCLOAK_IMPORT variable
$ docker run --name keycloak2 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8280:8080 -p 8543:8443 \
   -v "d:/dev/quarkus/security-keycloak-authorization-quickstart/import:/opt/jboss/keycloak/imports" \
   -e KEYCLOAK_IMPORT="/opt/jboss/keycloak/imports/realm-export.json -Dkeycloak.profile.feature.upload_scripts=enabled" \
   quay.io/keycloak/keycloak:15.0.2

Reference

  • http://www.helikube.de/import-a-keycloak-realm-with-docker-fails/
Published inAllgemein

Be First to Comment

Leave a Reply