-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
The documentation site states, that the --memory and --memory-swap options can be set as
@Rule
public GenericContainer memoryLimitedRedis = new GenericContainer<>("redis:3.0.2")
.withCreateContainerCmdModifier(cmd -> cmd.withMemory((long) 8 * 1024 * 1024))
.withCreateContainerCmdModifier(cmd -> cmd.withMemorySwap((long) 12 * 1024 * 1024));
though both got deprecated in docker-java/docker-java#1291 as this should be done via withHostConfig now:
private HostConfig hostConfig = HostConfig.newHostConfig()
.withMemory((long) 8 * 1024 * 1024)
.withMemorySwap((long) 12 * 1024 * 1024);
@Rule
public GenericContainer memoryLimitedRedis = new GenericContainer<>("redis:3.0.2")
.withCreateContainerCmdModifier(cmd -> cmd.withHostConfig(hostConfig);
gkfirst8 and bademux