-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Network priority not implemented in docker-compose version 3.0 #1372
Comments
+1 Interested in a response to this and when this will make it into v3? |
+1 as well. |
Running into this as well. |
+1 from me as well. We have a Swarm with thousands of containers running and some networks are basically used in every deployed stack for most services. We have sometimes the case, that the network where all the traffic is in (because of the problem mentioned here), just doesn't respond anymore when at the same time, the communication via the stacks default networks works just fine. This is a real issue for us. As Workaround we now prefix the default-networks of all stack with aaaa manually now. |
+1 ! This is also an issue for us. Also using traefik. |
+1 ! as this is also an issue for us. We'd like to be able to rely on the order the networks IP addresses are added to /etc/hosts so we can use the first address as a default for certain configuration parameters. So being able to rely on the first network in the list being actually treated as the first one would be great! |
+1 |
2 similar comments
+1 |
+1 |
Not having this is causing problems with my deployment of Reaction Commerce. |
+1 |
1 similar comment
+1 |
I may be wrong but it seems to me that docker-compose's implementation doesn't make a difference between v2 and v3. Connections are indeed created from an OrderDict sorted by priority, no matter v2 or v3 is used (see https://github.com/docker/compose/blob/master/compose/network.py#L325, and PR docker/compose#5566 clearly show that v3 is ok since at least jan 2018) Could anyone who know what happens next on the docker side explain why this priority isn't taken into account (BTW v2 and v3 priorities are equally ignored) ?
thanks ! |
+1 This is real pain. Please fix this. |
+1, besides respecting the compose spec for docker stack deploy which is still not allowing to mix v2 and v3... :( |
+1 Network priority not being available is really annoying. Prefixing network names works for now, but thats not a solution. |
We use a macvlan network as secondary network for non ip based protocols (PROFINET IO or DCP, based directly on layer 2 ethernet). In the container we need to know the network interface name which is bound to the macvlan ("eth1"). When the order of the network interfaces changes two things happen:
Our macvlan network is an external network defined by the company which delivers the OS running on the device. When a user names the directory which contains his docker-compose.yaml "zzzz_1234" we will get a problem, because docker compose uses this as a project name which will be used as the prefix of the default network name and causes the network interfaces to be swapped. The name of that directory might not even be under the control of the developer. This is really annoying, please fix it. |
Network priority is included in the Compose Specification (compose-spec.io) and is supported both by docker-compose 1.28+ and new Based on this, IMHO this issue could be closed (cc @thaJeztah) |
Created https://github.com/docker/compose-cli/issues/1785 as a follow-up issue to investigate correct implementation in Compose v2 |
docker-compose v2 had network priority, unfortunately docker-compose v3 does not have this functionality (yet?). See docker/cli#1372 Networks are assigned to containers using alphabetical order, in this case it means that "socket_proxy" is always ordered before "t2_proxy", this in turn means that the default gateway in containers is always the "socket_proxy" gateway and therefore the outgoing IP address to other containers. I believe this is wrong and the outgoing containers' IPs should always be the default networks gateway and respective IP as well as the traefik containers' IP - never the socket-proxy IP. I recently ran into this problem due to Authelia refusing oauth requests from container-to-container since I didn't allow the socket-proxy network to communicate via Authelia (because why should it, it should always just be container <-> docker sock). Taking the traefik container as an example: ### Before the change ```shell $ docker exec traefik route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.91.1 0.0.0.0 UG 0 0 0 eth0 192.168.90.0 * 255.255.255.0 U 0 0 0 eth1 192.168.91.0 * 255.255.255.0 U 0 0 0 eth0 ``` ### After the change (note the assignment of eth0/eth1) ```shell $ docker exec traefik route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.90.1 0.0.0.0 UG 0 0 0 eth0 192.168.90.0 * 255.255.255.0 U 0 0 0 eth0 192.168.91.0 * 255.255.255.0 U 0 0 0 eth1 ``` This could have been changed in docker-compose v2 with the `priority` attribute (assigning e.g. `priority: 10` to traefik), but this just doesn't work with docker-compose v3. 😐
I have docker-compose.yml v3.0 and i have issue from docker/compose#4645. Acording by documentations it is not implemented in 3.0. Is it planned to implement it? Or is there any reason why this feature was removed?
The text was updated successfully, but these errors were encountered: