[
https://issues.apache.org/jira/browse/MESOS-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15102041#comment-15102041
]
ASF GitHub Bot commented on MESOS-4370:
---------------------------------------
GitHub user travishegner opened a pull request:
https://github.com/apache/mesos/pull/87
[MESOS-4370] Retrieve network mode (name) and use that to get that networks
IP add…
…ress.
This patch will first query the docker API for the
`HostConfig.NetworkMode`, which is populated with the network name.
(Essentially what was passed in `--net <name>` to the docker run command). This
name is then used as a key in `NetworkSettings.Networks.<name>.IPAddress` to
get the IP address that is currently in use by the container.
It appears that even though the docker API has been set up to allow for
multiple networks, our testing has indicated that it's still only applying one
network to the container (the last one via the `--net` argument on the run
line). I can only speculate that the docker API will change again in the near
future, but I can't speculate how, so at least this fixes the problem as it
stands right now. This patch is tested against Docker 1.9.1 on Ubuntu 14.04.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/travishegner/mesos master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/mesos/pull/87.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #87
----
commit 75b98792b1d12bffacb74e1ce7444c67f0e0860e
Author: Travis Hegner <[email protected]>
Date: 2016-01-15T13:40:51Z
Retrieve network mode (name) and use that to get that networks IP address.
----
> NetworkSettings.IPAddress field is deprectaed in Docker
> -------------------------------------------------------
>
> Key: MESOS-4370
> URL: https://issues.apache.org/jira/browse/MESOS-4370
> Project: Mesos
> Issue Type: Bug
> Components: containerization, docker
> Affects Versions: 0.25.0, 0.26.0
> Environment: Ubuntu 14.04
> Docker 1.9.1
> Reporter: Clint Armstrong
>
> The latest docker API deprecates the NetworkSettings.IPAddress field, in
> favor of the NetworkSettings.Networks field.
> https://docs.docker.com/engine/reference/api/docker_remote_api/#v1-21-api-changes
> With this deprecation, NetworkSettings.IPAddress is not populated for
> containers running with networks that use new network plugins.
> As a result the mesos API has no data in
> container_status.network_infos.ip_address or
> container_status.network_infos.ipaddresses.
> The immediate impact of this is that mesos-dns is unable to retrieve a
> containers IP from the netinfo interface.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)