-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Description
Description
Trying to set a gateway to a specific address, but it won't be set.
If I try to set it to 10.10.1.100 the bridge adapter will still be set to 10.10.1.1.
This worked fine in v1, so unless the configuration have changed it could be a bug in v2.
Example:
services:
A:
image: nginx
networks:
mynet:
ipv4_address: '10.10.1.1'
networks:
mynet:
ipam:
config:
- subnet: '10.10.1.0/24'
gateway: '10.10.1.100'eirikb@eh ~/d/t/test> docker network ls
NETWORK ID NAME DRIVER SCOPE
a6cd841ba53a bridge bridge local
4a5d7a11984c host host local
66153911b158 none null local
d5c0ad6095d8 test_mynet bridge localeirikb@eh ~/d/t/test> ip a | grep 10.10
inet 10.10.1.1/24 brd 10.10.1.255 scope global br-d5c0ad6095d8eirikb@eh ~/d/t/test> docker network inspect test_mynet
...
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "10.10.1.0/24"
}
]
},
...Steps to reproduce the issue:
- Create a file
docker-compose.ymlwith contents as described above - Run
docker-compose up
Describe the results you received:
eirikb@eh ~/d/t/test> docker-compose up
[+] Running 2/2
⠿ Network test_mynet Created 0.0s
⠿ Container test-A-1 Created 0.5s
Attaching to test-A-1
Error response from daemon: Address already in useDescribe the results you expected:
No error
Output of docker compose version:
Docker Compose version 2.0.1
Additional environment details:
Tested on two different computers. Both running Arch Linux. Both Docker and Compose are from pacman.
Reactions are currently unavailable