Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Make weave IP preferred in /etc/hosts lookup, for 'attach'-ed addresses #1122

Open
bboreham opened this issue Jul 13, 2015 · 5 comments
Open
Labels

Comments

@bboreham
Copy link
Contributor

Remainder of #68, following merge of #1079.

A container started outside of weave and then attach-ed will have two IP addresses: one assigned by Docker and one assigned through weave. So hostname -I will return something like:

root@9b903541c5a7:/# hostname -I
172.17.0.72 10.0.0.61 

however, hostname -i returns the Docker-assigned IP:

root@9b903541c5a7:/# hostname -i
172.17.0.72

See conversation in #68 for justification.

bboreham added a commit that referenced this issue Jul 13, 2015
@rade
Copy link
Member

rade commented Oct 3, 2015

This might get fixed by #1477.

@inercia
Copy link
Contributor

inercia commented Oct 5, 2015

With #1477 :

root@094ab31b017d:/# hostname -I
172.17.0.121 10.32.0.2 
root@094ab31b017d:/# hostname -i
10.32.0.2

@rade rade added this to the 1.2.0 milestone Oct 5, 2015
@rade
Copy link
Member

rade commented Oct 9, 2015

I don't see how #1477, in its current form, can fix this, since there weave attach only rewrites /etc/hosts when called with a --rewrite-hosts option. And there is no simple fix for that either since a) we'd somehow need to get hold of the extra hosts from the --add-host options that were supplied on startup, and b) get hold of all weave IPs for a container so we don't populate /etc/hosts with partial information. Both of these are do-able but fiddly, so best left to a separate PR.

@inercia is my understanding correct?

@rade
Copy link
Member

rade commented Oct 9, 2015

#1477 does however, take care of rewriting /etc/hosts on weave run. Which is nice.

@rade rade modified the milestone: 1.2.0 Oct 22, 2015
@yaronr
Copy link

yaronr commented Dec 13, 2015

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants