Closed hohwille closed 2 months ago
you can use .withFileSystemBind("../docker/realm-export.json", "/opt/keycloak/data/import/realm-export.json",
Hi @hohwille
I can think of setting the --import-realm
flag as default, even if not import file is available. This wouldn't hurt if there's no file and one can simply set any file outside the classpath (with copy or bind) as import file.
Would that be ok for you?
Hi @hohwille I can think of setting the
--import-realm
flag as default, even if not import file is available. This wouldn't hurt if there's no file and one can simply set any file outside the classpath (with copy or bind) as import file. Would that be ok for you?
That would indeed be a great option.
You could also think about adding a withRealmImportFile
that takes a MoutableFile
as argument and make the String arg variant of this method use MountableFile.forClasspathResource(importFile)
and delegate to the MoutableFile
one.
@hohwille so, #138 will be ok for you?
@hohwille so, #138 will be ok for you?
Sure, you can close this issue if you implemented #138 However, also have a look at #137 and consider that in the same context.
Hopefully you've seen that for #137 there the PR #139 suggestion!?
Description
You have hardwired in your code that realm files must be on the classpath: https://github.com/dasniko/testcontainers-keycloak/blob/3bf421ac8cf50eaeb1fc978444e2bc3506f38116/src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java#L190-L197 I would like to reuse the config file I already have in my project for docker compose without duplicating it into
src/test/resources
. I can manually inject it into the container like this:However, I cannot set the
--import-realm
option then: https://github.com/dasniko/testcontainers-keycloak/blob/3bf421ac8cf50eaeb1fc978444e2bc3506f38116/src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java#L228It would be awesome to have a way to specify a regular file to import as realm e.g. like this:
Or otherwise have a way to add custom entries to
commandParts
e.g. viawithCommand
.Motivation
So that I am not forced to redundantly add the realm config I already have for docker compose into
src/test/resources
.Details
Already provided in description.