-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Connect to network according to network priorities #8561
Comments
I was able to confirm we run created https://docker.atlassian.net/browse/IL-255 to track this issue internally |
what is the reason for closing the issue? Has it been fixed? Any reference for tracking in which version it has been fixed? |
sorry, my bad (was too fast doing issue triage and transfert) |
Any new findings? This is a bug affecting especially container workload developers working with, say, industrial protocols that need direct layer 2 access and it's easy to mess the vNIC ordering up, even when developers clearly spelt-out their deployment requirements in compose v2 using network attachment priorities. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
keep issue open unless resolved |
This issue has been automatically marked as not stale anymore due to the recent activity. |
this bug seems to be still present in compose v3! |
this is a mess, as the priorities also get used in sorting endpoint lists for resolving service names in the embedded DNS resolver. |
Any update on this? |
Hi. I think this is a big problem. Please fix this ASAP. I really think this is a big problem |
There is any update on this? This issue is open for long time now without any resolution ... |
"dead in the water" comes to my mind as an especially fitting metaphor here. |
Ugh, this is incredibly frustrating. |
Could at least the documentation on priority be updated to show that this feature is completely not working on either V1 or V2? |
This doesn't work in V3 also. |
After more investigation, it appears While docker compose sort networks according to priority to invoke Closing this issue as "works as expected" (while not obvious until one dig into project history) |
just to clarify: the sorting bases on the (custom) network names, and not on the compose project network reference name, correct? |
@thediveo indeed. Docker engine has no visibility on compose network names used for reference by services. |
I have found report mentioning order of network interfaces in moby actually: moby/moby#37201 |
So is networking just broken in Docker / Docker compose, because that's what it seems like if there is no way to properly assign networks to interfaces. That's like networking 101. There is too much "magic" happening behind the scenes. There needs to be a straight forward way to say, we need eth0 on this container to be connected to this network. |
No, it's not "broken in compose", but in docker engine. Once moby/moby#37201 is implemented compose would be able to offer what you expect |
The problem is that a fix could break existing configurations. If it is known how the fix would look like we could prepare for it, even if it never comes. Would the fix use the priority to the order or how would it work? How can we prepare for a potential fix? |
There is a priority attribute, which kind of introduces sorting into the network interfaces world, but it is actually useless. Maybe it is time to fix this. |
Is it reliable to assume that this priority field would be used in future for the ordering of the interface assignment? The order is not really good because when attaching network interfaces to a running container the names will depend on the order of execution. For the first interface (the default gateway) it would be ok for me to name that "eth0" because that one has a special role. Michael |
|
IIRC the default MAC address is solely based on the IP address, that means the last 4 digits of the MAC address are the 4 digits of the ipv4 address. Here an example, 172.17.0.2 = ac:11:00:02 :
Or do you mean the Michael |
Yes, it does affect order of attaching network interfaces and does not affect attaching of network interfaces at the same time. I was really surprised that it does not do anything regarding the order of interfaces in the container actually. |
It would be really great if the priority field would be used for ordering the interface name assignment. This introduces major issues when using external networks in docker compose, as service names that are defined in a compose file might not get resolved correctly and service addresses from other networks the container is connected to are returned. For example when using a service name 'db' in two compose projects and connecting them via external network, it's undefined which host will be resolved when using the service name unless the host name is extended with the network name. This however depends on the compose project name, so a service configuration now has to be rewritten depending on the name of the project, including the configuration of applications. This can lead to compose files being readily provided by third parties to break when adding a custom network, for example to add a reverse proxy via service network from another compose project. In addition the compose spec states that the priority field defines the order of interface connection which for docker also defines the naming of the interfaces, as the first one being attached will be eth0 and get the default route. All in all this is very frustrating, given that a google search gives me several issues that have been closed describing this exact problem over the last years. While it might 'work as designed' from a technical standpoint, the documentation is misleading and having the order defined by lexical order of names is unexpected and completely removes the strict separation of docker compose projects when it comes to service name resolution. |
This is a follow-up for docker/cli#1372
see https://gist.github.com/jfellus/cfee9efc1e8e1baf9d15314f16a46eca for a reproduction scenario
The text was updated successfully, but these errors were encountered: