When creating containers inside a user-defined bridge network without specifying an IP address, the started containers are given IP address starting from the beginning of the IP range. When a container goes down, its IP address becomes available again and can later be used by another container. Docker also detects duplicate IPs and raise exceptions when invalid addresses are supplied. As far as my research goes, the docker daemon is not depending on any DHCP services. So how does Docker actually figure out which IP addresses is in use/available for a new container? Furthermore, how can a docker network plugin (such as docker-go-plugin
) do the same thing?
I think one of the keywords here is IPAM, but I don’t know anything apart from that. I’d appreciate every piece of information that points me to the right direction. Thanks in advance.