I'm trying to export a realm file into keycloak docker container, I'm not able to do that because the server is runing when I execute this command:
bin/standalone.sh -Dkeycloak.migration.action=export
-Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=<DIR TO EXPORT TO>
I tried to modify the docker-entrypoint.sh and I delete the command which executes the server to launch:
#!/bin/bash
if [ $KEYCLOAK_USER ] && [ $KEYCLOAK_PASSWORD ]; then
keycloak/bin/add-user-keycloak.sh --user $KEYCLOAK_USER --password $KEYCLOAK_PASSWORD
fi
if [ "$DB_VENDOR" == "POSTGRES" ]; then
databaseToInstall="postgres"
elif [ "$DB_VENDOR" == "MYSQL" ]; then
databaseToInstall="mysql"
elif [ "$DB_VENDOR" == "H2" ]; then
databaseToInstall=""
else
if (printenv | grep '^POSTGRES_' &>/dev/null); then
databaseToInstall="postgres"
elif (printenv | grep '^MYSQL_' &>/dev/null); then
databaseToInstall="mysql"
fi
fi
if [ "$databaseToInstall" != "" ]; then
echo "[KEYCLOAK DOCKER IMAGE] Using the external $databaseToInstall database"
/bin/sh /opt/jboss/keycloak/bin/change-database.sh $databaseToInstall
else
echo "[KEYCLOAK DOCKER IMAGE] Using the embedded H2 database"
fi
exit $?
However I got a caschLoopBack
when I run the pod of keycloak. Is there any solution to make the export inside the docker container and stop the server from running?