{"action":"created","issue":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/509","repository_url":"https://api.github.com/repos/testcontainers/testcontainers-java","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/509/labels{/name}","comments_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/509/comments","events_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/509/events","html_url":"https://github.com/testcontainers/testcontainers-java/issues/509","id":278433451,"number":509,"title":"Deprecation of getIpAddress","user":{"login":"arcuri82","id":14858082,"avatar_url":"https://avatars2.githubusercontent.com/u/14858082?v=4","gravatar_id":"","url":"https://api.github.com/users/arcuri82","html_url":"https://github.com/arcuri82","followers_url":"https://api.github.com/users/arcuri82/followers","following_url":"https://api.github.com/users/arcuri82/following{/other_user}","gists_url":"https://api.github.com/users/arcuri82/gists{/gist_id}","starred_url":"https://api.github.com/users/arcuri82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcuri82/subscriptions","organizations_url":"https://api.github.com/users/arcuri82/orgs","repos_url":"https://api.github.com/users/arcuri82/repos","events_url":"https://api.github.com/users/arcuri82/events{/privacy}","received_events_url":"https://api.github.com/users/arcuri82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-01T11:11:50Z","updated_at":"2017-12-02T18:44:44Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n I am starting a Docker image `x` with `GenericContainer`, and then a browser with `BrowserWebDriverContainer` which will connect to the other image. As such, I need to know the IP address of `x`. To do it, one can use:\r\n\r\n`x.getContainerInfo().getNetworkSettings().getIpAddress()`\r\n\r\nIt works, but it is marked as deprecated. That makes sense, as an image might have different networks and IP addresses. But, in typical testing scenarios, one would expect just one. So, to avoid the deprecated method, I need to write something like:\r\n\r\n`x.getContainerInfo().getNetworkSettings().getNetworks().values().iterator().next().getIpAddress()`\r\n\r\nwhich works, but only under the assumption that there is only one network. Furthermore, it is far too verbose. It would be great to have an API to call the above with a single method, eg\r\n\r\n`x.getInternalIpAddress()`\r\n\r\nwhich could throw an IllegalStateException if more than one network exists. "},"comment":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/comments/348711594","html_url":"https://github.com/testcontainers/testcontainers-java/issues/509#issuecomment-348711594","issue_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/509","id":348711594,"user":{"login":"kiview","id":5088104,"avatar_url":"https://avatars0.githubusercontent.com/u/5088104?v=4","gravatar_id":"","url":"https://api.github.com/users/kiview","html_url":"https://github.com/kiview","followers_url":"https://api.github.com/users/kiview/followers","following_url":"https://api.github.com/users/kiview/following{/other_user}","gists_url":"https://api.github.com/users/kiview/gists{/gist_id}","starred_url":"https://api.github.com/users/kiview/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiview/subscriptions","organizations_url":"https://api.github.com/users/kiview/orgs","repos_url":"https://api.github.com/users/kiview/repos","events_url":"https://api.github.com/users/kiview/events{/privacy}","received_events_url":"https://api.github.com/users/kiview/received_events","type":"User","site_admin":false},"created_at":"2017-12-02T18:44:43Z","updated_at":"2017-12-02T18:44:43Z","author_association":"MEMBER","body":"Hey @arcuri82, for this use case, it's best to use networks.\r\nSee the unit tests for how to use them:\r\nhttps://github.com/testcontainers/testcontainers-java/blob/master/core/src/test/java/org/testcontainers/containers/NetworkTest.java\r\nYou can also use network aliases and access the other container by name.\r\n\r\n@bsideup I think we are currently lacking documentation of the networking feature?"}}
{"actor":{"display_login":"kiview"}}