-
Notifications
You must be signed in to change notification settings - Fork 670
Docker 1.8+ breaks resolution of unqualified names #1374
Comments
Here is an example:
And, when I ran another container with
|
My guess is that libnetwork does something fun and new, to support their "service" model. So we can count on this appearing in a docker release at some point (1.9 I would think). |
I wonder if there is a way to opt-out from this, which might require a pull-request to docker/docker... |
Docker always updated the hosts file when using |
What actually breaks here, for typical applications? Presumably the IP addresses added by docker are in fact reachable. Communication will go over the docker bridge instead of weave bridge, but most apps won't care about that. |
Yes. However, we need to confirm that given
True, but in some case user may chose to bind to |
As a workaround, unlinking |
Need to check whether this breaks Docker's link functionality + behaviour around stopping/starting containers |
Actually this behaviour is in 1.8 as well - moby/moby#15617 is apropos |
This is the prototype I mentioned:
Whilst it stops dynamic updates, it does nothing to filter out entries relating to containers that were started already, so it's not going to be sufficent:
As discussed in person, it obstructs use of weaveDNS load balancing and resilience. |
Removing my assignment to focus on FDP review. |
@awh when you say "so it's not going to be sufficent", what else do you think we would need in order to solve this issue? |
@inercia I was thinking that we should perhaps overwrite (rather than modify) the /etc/hosts we inherit from Docker before unlinking it. Ideally we would do so in a way that mimics the 'old' behaviour of Docker - that would mean processing the additional hosts passed to |
The alternative would be to somehow filter out the unwanted service entries, but it may not be possible to distinguish them easily... |
@awh could we just remove all the |
ah, "forall X in X.bridge: delete X; delete X.bridge"? |
I believe "bridge" is some sort of "network name", so not necessarily constant. Plus Docker might well invent yet more ways of putting things in /etc/hosts, so a "remove what Docker added" strategy is prone to failure. |
We are obviously circumvencting Docker's actions, so it is a strategy as prone to failures as any other |
We could also perform a more selective removal, where we remove X iff X is a valid name in the weave network... |
We don't know all names upfront, and we don't want to continuously rewrite /etc/hosts. |
So what approach would you suggest for solving this, @rade? |
#1374 (comment) (minus the 'links' bit) |
And how do we know if an |
We know about the |
And what about containers that were started with |
no idea. check :) |
We can get the list of |
Looks like the fix here is going to be somewhat fiddly. -> moving from 1.1.1 to 1.2.0 |
@rade I guess we must always remove&rewrite |
I can envisage situations in which our rewriting of So I think we still want hostname rewriting to be optional, but enabled by default. So the flag should become |
So just to check: the choice is between things possibly breaking badly, and unqualified hostnames working; and the recommendation is to make things possibly breaking badly the default. This might be OK if it is obvious, when things do break badly, what is the remedy. |
Dynamic I am curious what the unqualified name refers to in the new Docker 1.9 networking world when a container is attached to multiple networks. |
I was able to use Weave 1.0.2 with experimental Docker, but it turns out that short hostnames are not working as expected due to
/etc/hosts
being populated with entries dynamically.I've used Docker Machine to setup a test VM and it gave me moby/moby@5dadfa8 build from Aug 26 17:33:57 UTC 2015.
The text was updated successfully, but these errors were encountered: