Docker Community Forums

Share and learn in the Docker community.

DHCP option for macvlan container?

Hi All,

I’m fairly new to Docker. I am investigating using the macvlan network driver for containers, but would like the IP addresses in the containers to be assigned from the same DHCP server that assigns the IP address of the docker host.

I found some old blog posts (circa 2016) referring me to a project called “pipework”. The pipework page says to ask on the Docker forums if the functionality I’m looking for may already exist in docker, since the end-goal appears to be that pipework eventually should not be needed.

So my question is: is it possible to have a container use an external DHCP server or client from the host to get an IP address? Is there an IPAM plugin for this or some other way to do it, or is the way the pipework script does it still the only/best way?

Thanks for any input or suggestions!

Oops, forgot to mention system details:

Linux Centos 7.7.1908
Docker 1.13.1 – system has been around for a while and I may be able to recommend upgrading to a newer version if it makes sense or is necessary