-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] V2 Compose can't attach multiple networks reliably #10805
Comments
I've found this problem more likely when multiple compose files (-f arguments) are on the docker compose command line. Create 3 separate Docker Compose specifications - each defines its own user-defined bridge network, the third also connects to the bridge network of each of the first two. In detail fred.yml
harry.yml
bill.yml
Bring up the networks and the containers
It seems that the behaviour varies depending on the order of the -f arguments, and the behaviour is non-deterministic (so, sometimes all networks are established as expected, sometimes they are not) To reveal the incomplete network setup, do two commands
|
+1 |
+1 We suffer from this bug, too |
tested with latest codebase, can't reproduce. |
Good Morning,
May you can get a bit more detailed with this statement? The Release v2.20 is out since 5 days and it is still not in the Debian repositories of Docker. Neither test nor stable. With respect to all of the docker compose developers - this is a really cool tool, but this bug fucked up so many infrastructures in the last days and i am currently struggling with version pinning to v2.18.1 and so on. This is really not sustainable and very annoying for me as a sysadmin. May you can take a look whats going on there and why the release isn't published in the apt repositories? Thank you! |
@WhoAmI0501 the debian package are generated as part of docker engine release and won't get updated by a docker compose release. In the meantime you can install by downloading binaries from https://github.com/docker/compose/releases/tag/v2.20.0 |
The speed at which this defect was resolved is impressive. Downloading binaries containing the fix is fine for test systems. However, given the non-deterministic behaviour of Compose with this defect present, in a global context it becomes a game of whack-a-mole until such time as the fix emerges from the various package repositories. I humbly suggest that an updated Docker Engine release that contains this fix should be given serious consideration. |
#10778 mentions "ServiceConfig::NetworksByPriority is neither deterministic nor stable when networks have the same priority." A workaround for us was to explicitly assign disjunct priorities to the networks of a service. Adapted configuration from the test-case above:
|
PS: v2 is definitely released for Debian/Ubuntu now |
Description
When multiple networks (~ more than 4) are defined in
docker-compose.yml
and attached to a service withdocker compose up
, often will one network - seemingly randomly and changing with each container recreation - not be attached to the container (docker inspect container
).If you recreate with
docker compose up --force-recreate
, it's very likely that missing, unattached network will now be another one; only rarely will all networks be attached as expected. However, even with 20 networks, it's always only one network that doesn't get attached, the rest are fine.This problem only occurs with V2
docker compose
! Starting your container/stack with the deprecated V1docker-compose
works perfectly fine.Steps To Reproduce
Compose Version
Docker Environment
Anything else?
Tested this with Fedora 38 as well as Debian 11, also with different Docker images; Behavior remains the same.
The text was updated successfully, but these errors were encountered: