diff --git a/quarkus-test-service-keycloak/src/main/java/io/quarkus/test/services/containers/KeycloakGenericDockerContainerManagedResource.java b/quarkus-test-service-keycloak/src/main/java/io/quarkus/test/services/containers/KeycloakGenericDockerContainerManagedResource.java index 48fa00eac..5af669376 100644 --- a/quarkus-test-service-keycloak/src/main/java/io/quarkus/test/services/containers/KeycloakGenericDockerContainerManagedResource.java +++ b/quarkus-test-service-keycloak/src/main/java/io/quarkus/test/services/containers/KeycloakGenericDockerContainerManagedResource.java @@ -1,7 +1,5 @@ package io.quarkus.test.services.containers; -import java.util.Optional; - import org.apache.commons.lang3.StringUtils; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; @@ -40,8 +38,10 @@ protected GenericContainer initContainer() { } container.withCreateContainerCmdModifier(cmd -> cmd.withName(DockerUtils.generateDockerContainerName())); - container.withCreateContainerCmdModifier(cmd -> Optional.ofNullable(cmd.getHostConfig()) - .ifPresent(config -> config.withMemory(convertMiBtoBytes(model.getMemoryLimitMiB())))); + + // Currently, we can't properly set the container's memory limit when running with Podman. + // More details on this issue can be found here: https://github.com/quarkus-qe/quarkus-test-suite/issues/2106 + container.withEnv("JAVA_OPTS_APPEND", String.format("-XX:MaxRAM=%sm", model.getMemoryLimitMiB())); if (isReusable()) { Log.info(model.getContext().getOwner(), "Running container on Reusable mode");