This image lets you quickly setup a DHCPv4 server based on CentOS 7 and its dhcp
package.
To build, run:
docker build --tag=centos-dhcpd:latest .
You need to have a directory in your system that contains the configuration files for the DHCP server. This folder will be mounted as /etc/dhcp
inside the container. For example /home/john/dhcp-config
, in which you can place a file, /home/john/dhcp-config/dhcpd.conf
, that contains your DHCP server configuration.
To run the container:
docker run --rm -d --network host -v /home/john/dhcp-config:/etc/dhcp --name dhcpd adevur/centos-dhcpd
If you want to start the DHCP server automatically on boot:
docker run --rm --restart always -d --network host -v /home/john/dhcp-config:/etc/dhcp --name dhcpd adevur/centos-dhcpd
- In order to start the DHCP server, this image uses the very same command described in the official systemd service unit of
dhcp
package. This unit can be found at:/lib/systemd/system/dhcpd.service
, the command is:/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid
- This image uses
dumb-init
as its init system.