Title: How to read the IP addresses of swarm tasks? · Issue #1140 · docker-java/docker-java · GitHub
Open Graph Title: How to read the IP addresses of swarm tasks? · Issue #1140 · docker-java/docker-java
X Title: How to read the IP addresses of swarm tasks? · Issue #1140 · docker-java/docker-java
Description: Hi, Is there any way to read the ip address of swarm tasks? I make a docker client poniting to the leader of the swarm via: DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost("unix:///var/r...
Open Graph Description: Hi, Is there any way to read the ip address of swarm tasks? I make a docker client poniting to the leader of the swarm via: DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfig...
X Description: Hi, Is there any way to read the ip address of swarm tasks? I make a docker client poniting to the leader of the swarm via: DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfig...
Opengraph URL: https://github.com/docker-java/docker-java/issues/1140
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to read the IP addresses of swarm tasks?","articleBody":"Hi,\r\n\r\nIs there any way to read the ip address of swarm tasks? \r\n\r\nI make a docker client poniting to the leader of the swarm via:\r\n\r\n```\r\n DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost(\"unix:///var/run/docker.sock\").build();\r\n DockerClient client = DockerClientBuilder.getInstance(config).build();\r\n```\r\n\r\nI read the tasks of a service by:\r\n\r\n```\r\n List\u003cTask\u003e tasks = client.listTasksCmd().withServiceFilter(serviceName).exec();\r\n```\r\n\r\nThen I tried the following two ways to find the ip address of a task:\r\n\r\n1) fetching continer by id:\r\n\r\n```\r\n TaskStatus status = task.getStatus();\r\n TaskStatusContainerStatus containerStatus = status.getContainerStatus();\r\n String containerID = containerStatus.getContainerID();\r\n List\u003cString\u003e idfilter = new ArrayList\u003c\u003e();\r\n idfilter.add(id);\r\n List\u003cContainer\u003e list = client.listContainersCmd().withShowAll(true).withIdFilter(idfilter).exec();\r\n```\r\n\r\n2) fetching container from overlay network:\r\n\r\n```\r\n List\u003cNetwork\u003e netList = client().listNetworksCmd().withNameFilter(new String[]{netName}).exec();\r\n Network network = netList.get(0);\r\n Map\u003cString, Network.ContainerNetworkConfig\u003e containers = network.getContainers();\r\n```\r\n\r\nBut both return an empty list - or they do not return the containers that are placed on other swarm nodes. \r\n\r\nIs this feature supported in the API? \r\n\r\nThanks!","author":{"url":"https://github.com/kamalhakim","@type":"Person","name":"kamalhakim"},"datePublished":"2018-11-29T09:46:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/1140/docker-java/issues/1140"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5e2b4228-246a-7263-1d5f-9844f08b6414 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C246:2FD3CA:1AC49E9:24D8779:697391FC |
| html-safe-nonce | 1995abcde69a2a716867e60d0de659164240aea447813734d848fb6841120358 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjQ2OjJGRDNDQToxQUM0OUU5OjI0RDg3Nzk6Njk3MzkxRkMiLCJ2aXNpdG9yX2lkIjoiNjAyOTY3Njg0NjQ4NTE0NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bda70872a2fed9ffebcbc1cbfde08dc6197e8ecbdf0b5fa7851835337e72f80c |
| hovercard-subject-tag | issue:385649848 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-java/docker-java/1140/issue_layout |
| twitter:image | https://opengraph.githubassets.com/59a9687089c899ca1b0dcd52b1e1b266de00259cee662a6eb6eaa95e7aac8808/docker-java/docker-java/issues/1140 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/59a9687089c899ca1b0dcd52b1e1b266de00259cee662a6eb6eaa95e7aac8808/docker-java/docker-java/issues/1140 |
| og:image:alt | Hi, Is there any way to read the ip address of swarm tasks? I make a docker client poniting to the leader of the swarm via: DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfig... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kamalhakim |
| hostname | github.com |
| expected-hostname | github.com |
| None | f0b5e2d1da32de5a0b7bcfbc5ba007c93e8e63098fba29e1200efb674aa72e66 |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git |
| octolytics-dimension-user_id | 7772003 |
| octolytics-dimension-user_login | docker-java |
| octolytics-dimension-repository_id | 20415251 |
| octolytics-dimension-repository_nwo | docker-java/docker-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20415251 |
| octolytics-dimension-repository_network_root_nwo | docker-java/docker-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6fc3acd8abe8a5ec0c4bf4d09d9e27d14301112d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width