-
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] Container created by Docker Compose 2.24.6 fails to reconnect to default NAT network on Windows restart #11524
Comments
Same here, for me the workaround was adding network_mode: nat
Might be useful: |
The workaround of @mllab-nl worked for me, however this bug needs to be addressed. Bumping. |
Same issue on my side, running on Unraid. services:
homeassistant:
container_name: homeassistant
image: lscr.io/linuxserver/homeassistant
restart: always
privileged: true
environment:
- TZ=Europe/Berlin
- TCP_PORT_8123=8123
- PUID=99
- PGID=100
- UMASK=022
volumes:
- /mnt/user/Docker/config/homeassistant:/config
network_mode: br0
networks:
br0:
ipv4_address: 192.10.10.110
networks:
br0:
external: true get the following error on portainer Failed to deploy a stack: service homeassistant declares mutually exclusive |
Try to remove the other network attributes @Karatekid2407, as those are incompatible with |
I understand but my current implementation is the same as the one from @mllab-nl which is working? Or do I miss something? |
Maybe it could work for a past version of compose? I removed the |
Ok but how can I then specify a fixed IP? I did not find any solution. The only idea I have at the moment is to
|
Description
Description:
I am experiencing an issue with Docker Compose 2.24.6 on Windows, using Docker version 25.0.3. The problem revolves around how these versions handle network connections to a pre-made NAT network after a system restart. This behaviour is inconsistent with that observed in Docker Compose 1.29.2 and when using Docker commands directly (docker run), which manage the scenario as expected.
To observe the behaviour, follow the steps described in the "Steps To Reproduce" section for both versions 2.24.6 and 1.29.2.
Steps To Reproduce
Findings:
Error: "could not find a network matching network mode 96d6b0255d82eb1f904a9a502f333957a5260bee69fd16b2ecf5f337a23f72de: network 96d6b0255d82eb1f904a9a502f333957a5260bee69fd16b2ecf5f337a23f72de not found."
Core Issue:
The difference in the output of docker inspect between versions 1.29.2 and 2.24.6 is crucial. It reveals that version 1.29.2 connects to the network using its name, as anticipated, while version 2.24.6 uses the network ID for connection. This approach poses a problem after a system restart because the NAT network, though persistently present, is regenerated with a new ID. Consequently, this leads to a failure for containers expecting the network to retain the ID it had before the restart.
Temporary Workaround:
I have temporarily addressed this issue by transitioning from Docker Compose to a script that utilizes docker run. This method consistently delivers the expected behaviour, similar to Docker Compose version 1.29.2, by connecting to the network using its name.
Compose Version
Docker Environment
Anything else?
This issue renders the solutions specified in the following issue unusable: docker/for-win#3076
The text was updated successfully, but these errors were encountered: