Skip to content

Conversation

@tschmidt01
Copy link

@tschmidt01 tschmidt01 changed the title Adapt to non deprecated way of setting --memory and --memory-swap Adapt docs to non deprecated way of setting --memory and --memory-swap Apr 2, 2020
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));
.withCreateContainerCmdModifier(cmd -> cmd.withHostConfig(hostConfig);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect.

It should be -> cmd.withHostConfig(cmd.getHostConfig().withMemory((long) 8 * 1024 * 1024))-like.

Otherwise, you're overwriting the previously set host values

@rnorth
Copy link
Member

rnorth commented Jul 3, 2020

We should finish this off - @tschmidt01 would you like to do it, or do you not have time?

@rnorth rnorth self-assigned this Jul 5, 2020
@rnorth
Copy link
Member

rnorth commented Jul 5, 2020

I've tweaked.

@rnorth rnorth merged commit 66e6a2f into testcontainers:master Jul 5, 2020
@tschmidt01
Copy link
Author

Thanks for finishing up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants