Closed ccope closed 9 years ago
You're right.
Ideally I don't want to have to keep track of state, or run a DHCP server.
I think the best way to deal with this is to have unique IP and MAC addresses deterministically generated from the container IDs.
Yeah, I was thinking about that. You could try generating them sequentially, but if you need to wrap (there are only ~250 addresses in the default bridge network) then you have to check which addresses are free.
It looks like I need to solve or at least work around #10 before fixing this. Currently there are 89999 possible UUIDs so conflicts are fairly rare.
If we go for deterministically generated IPs and limit ourselves to a maximum of 253 containers (a fair limit imo) the odds of conflicts go way up.
This would prevent you from running two webservers on port 80, for instance. If doing dhcp isn't possible, the next best thing would be to maintain a list of currently used IPs.