I have the following GenericContainer:
/**
* A docker container that can be used with an @ClassRule to start the container before
* and tear it down after a test class. This container exposes port 9200 as 9201 and port 9300 as 9301.
* It also copies over the elasticsearch.yml file from the test resources.
*/
public class ElasticsearchTestContainer extends GenericContainer {
private static final ImageFromDockerfile IMAGE_FROM_DOCKERFILE =
new ImageFromDockerfile("test-es-image", false)
.withDockerfileFromBuilder(builder -> builder
.from("elasticsearch:2.2")
.run("/usr/share/elasticsearch/bin/plugin install analysis-icu")
.run("/usr/share/elasticsearch/bin/plugin install delete-by-query")
.copy("elasticsearch.yml", "/usr/share/elasticsearch/config/elasticsearch.yml")
.build()
).withFileFromClasspath("elasticsearch.yml", "docker/elasticsearch.yml");
public ElasticsearchTestContainer() {
super(IMAGE_FROM_DOCKERFILE);
this.setPortBindings(Arrays.asList("9201:9200", "9301:9300"));
this.setNetworkMode("devhost.hostname.com");
this.setWaitStrategy(Wait.forHttp("/"));
}
}
Normally, I would specify the memory using the -m flag to docker. How can I do this with this container?
I have the following
GenericContainer:Normally, I would specify the memory using the
-mflag to docker. How can I do this with this container?