compose-cli
compose-cli copied to clipboard
Docker compose networking doesn't work any more
I have several previously working docker-compose projects and suddenly hostname, networks and especially network: aliases: do not work any more with docker-compose.
In the last few days I've seen this in multiple projects. The documentation is not updated at all, while both my dev and production environments break.
I've chose docker to have a stable tool and now it seems they reinvent their whole networking stack. It's a big mess.
I feel the new docker compose also has hiccups when you define several networks for a service. I think there is different behaviour between these two yaml definitions, even though they should be the same:
services:
app:
networks:
- foo
- bar
and
services:
app:
networks:
foo:
bar:
and
services:
app:
networks:
foo:
aliases:
- breakingchanges
bar:
and
services:
app:
networks:
bar:
foo:
aliases:
- breakingchanges
Having a similar issue, both mongo and proxy networks are external. Sometimes the containers will be attached to the mongo network, sometimes they will not. It is a bizarre behavior.
services:
app:
networks:
- proxy
- mongo
I do not see anything in the daemon logs that could be related to this. Rolling back to version 2.17.3 of docker compose plugin might have fixed the issue, but I will have to wait and see to be sure.
@mzglinski there was a docker-compose update released yesterday which fixes this bug. It was a "random" network interface not working bug for 5 days. I nearly went crazy.
Just update and check again please. Then we can close this issue.
@bf Oh, thanks for the heads up. 2.20 is not yet available in the Debian repository but I will update and check once it is.
Getting the update on Debian took a while, but I can confirm it is working as expected now.