docker-archive / compose-cli

Easily run your Compose application to the cloud with compose-cli
Apache License 2.0
957 stars 255 forks source link

Docker compose networking doesn't work any more #2255

Open bf opened 1 year ago

bf commented 1 year ago

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.

bf commented 1 year ago

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
mzglinski commented 1 year ago

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.

bf commented 1 year ago

@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.

mzglinski commented 1 year ago

@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.

mzglinski commented 1 year ago

Getting the update on Debian took a while, but I can confirm it is working as expected now.