{"action":"created","issue":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/298","repository_url":"https://api.github.com/repos/testcontainers/testcontainers-java","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/298/comments","events_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/298/events","html_url":"https://github.com/testcontainers/testcontainers-java/issues/298","id":210147490,"number":298,"title":"Is there a way to set the memory capacity for a `GenericContainer`?","user":{"login":"macks22","id":3409997,"avatar_url":"https://avatars3.githubusercontent.com/u/3409997?v=3","gravatar_id":"","url":"https://api.github.com/users/macks22","html_url":"https://github.com/macks22","followers_url":"https://api.github.com/users/macks22/followers","following_url":"https://api.github.com/users/macks22/following{/other_user}","gists_url":"https://api.github.com/users/macks22/gists{/gist_id}","starred_url":"https://api.github.com/users/macks22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macks22/subscriptions","organizations_url":"https://api.github.com/users/macks22/orgs","repos_url":"https://api.github.com/users/macks22/repos","events_url":"https://api.github.com/users/macks22/events{/privacy}","received_events_url":"https://api.github.com/users/macks22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-02-24T20:16:16Z","updated_at":"2017-03-01T10:56:35Z","closed_at":null,"body":"I have the following `GenericContainer`:\r\n\r\n```\r\n/**\r\n * A docker container that can be used with an @ClassRule to start the container before\r\n * and tear it down after a test class. This container exposes port 9200 as 9201 and port 9300 as 9301.\r\n * It also copies over the elasticsearch.yml file from the test resources.\r\n */\r\npublic class ElasticsearchTestContainer extends GenericContainer {\r\n\r\n    private static final ImageFromDockerfile IMAGE_FROM_DOCKERFILE =\r\n            new ImageFromDockerfile(\"test-es-image\", false)\r\n                    .withDockerfileFromBuilder(builder -> builder\r\n                            .from(\"elasticsearch:2.2\")\r\n                            .run(\"/usr/share/elasticsearch/bin/plugin install analysis-icu\")\r\n                            .run(\"/usr/share/elasticsearch/bin/plugin install delete-by-query\")\r\n                            .copy(\"elasticsearch.yml\", \"/usr/share/elasticsearch/config/elasticsearch.yml\")\r\n                            .build()\r\n                    ).withFileFromClasspath(\"elasticsearch.yml\", \"docker/elasticsearch.yml\");\r\n\r\n    public ElasticsearchTestContainer() {\r\n        super(IMAGE_FROM_DOCKERFILE);\r\n        this.setPortBindings(Arrays.asList(\"9201:9200\", \"9301:9300\"));\r\n        this.setNetworkMode(\"devhost.hostname.com\");\r\n        this.setWaitStrategy(Wait.forHttp(\"/\"));\r\n    }\r\n}\r\n```\r\n\r\nNormally, I would specify the memory using the `-m` flag to docker. How can I do this with this container?"},"comment":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/comments/283309558","html_url":"https://github.com/testcontainers/testcontainers-java/issues/298#issuecomment-283309558","issue_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/298","id":283309558,"user":{"login":"rnorth","id":132175,"avatar_url":"https://avatars2.githubusercontent.com/u/132175?v=3","gravatar_id":"","url":"https://api.github.com/users/rnorth","html_url":"https://github.com/rnorth","followers_url":"https://api.github.com/users/rnorth/followers","following_url":"https://api.github.com/users/rnorth/following{/other_user}","gists_url":"https://api.github.com/users/rnorth/gists{/gist_id}","starred_url":"https://api.github.com/users/rnorth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnorth/subscriptions","organizations_url":"https://api.github.com/users/rnorth/orgs","repos_url":"https://api.github.com/users/rnorth/repos","events_url":"https://api.github.com/users/rnorth/events{/privacy}","received_events_url":"https://api.github.com/users/rnorth/received_events","type":"User","site_admin":false},"created_at":"2017-03-01T10:56:35Z","updated_at":"2017-03-01T10:56:35Z","body":"It looks like [it's there](https://github.com/docker-java/docker-java/blob/419900d074e6d9754dcd5c6290d93c3350bab010/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java#L355) on CreateContainerCmd. It's worth supporting, but we might be opening a can of worms if we add this directly to the GenericContainer API.\r\n\r\nPerhaps the more maintainable approach is to use some upcoming preconfig/postconfig hooks that @bsideup was working on that allow you to modify the CreateContainerCmd directly before it's created. How does that sound?"}}
{"actor":{"display_login":"rnorth"}}