4.3.5, 4.3.5-r0, latest (4.3.5-r0/Dockerfile)]DHCP is a well know service allowing you to serve IP addresses and network information (DNS, gateway, etc.) to your LAN.
This image is a vanilla DHCP software without any additional packages installed.
This image is based on Alpine Linux. Alpine Linux is generally immune to vulnerabilities targetting components not installed in this Operating System, such as: bash (e.g. Shellshock vulnerability), OpenSSL (e.g. Heartbleed vulnerability), glibc (e.g Ghost vulnerability). Also, Alpine Linux has a much smaller image size compared to other OS thanks to less packages installed by default and not relying on glibc, providing faster image download, and reduced attack surface, hence better security.

Guillaume Kaddouch
Blog: https://networkfilter.blogspot.com/
Twitter: @gkweb76
Github: gkweb76
First create your volumes:
docker volume create dhcp
docker volume create dhcp_leases
docker volume inspect dhcp | grep Mount
Grab the host real path, for instance /var/lib/docker/volumes/dhcp/_data (referred as '$DHCP_VOLUME_PATH' below)
Then copy your dhcpd.conf there, using the correct path:
cp ./dhcpd.conf $DHCP_VOLUME_PATH
Apply a strict chmod so that only root can modify these files:
chmod 644 $DHCP_VOLUME_PATH/dhcpd.conf
Finally start your container:
-> modify the eth0 interface at the end to match your interface name
docker container run --rm -v dhcp:/etc/dhcp -v dhcp_leases:/var/lib/dhcp --net=host \
--read-only=true --tmpfs /run/dhcp -p 67:67/udp --name dhcp gkweb76/dhcp \
/usr/sbin/dhcpd -4 -d -cf /etc/dhcp/dhcpd.conf eth0
version: "3.5"
services:
dhcp:
image: gkweb76/dhcp:latest
container_name: dhcp
read_only: yes
network_mode: "host"
volumes:
- dhcp:/etc/dhcp # put your conf files here
- dhcp_leases:/var/lib/dhcp
- /etc/localtime:/etc/localtime:ro # keep container clock in sync with host
tmpfs:
- /run/dhcp
command: ["/usr/sbin/dhcpd", "-4", "-d", "-cf", "/etc/dhcp/dhcpd.conf", "eth0"] # specify your host LAN interface
restart: "unless-stopped"
# Volumes declaration
volumes:
dhcp:
dhcp_leases:
If you need help with your compose file, check the official documentation.
Ubuntu 18.04 LTS and Docker 18.04.0 CE (Community Edition).
MIT License
Content type
Image
Digest
Size
3.5 MB
Last updated
over 8 years ago
docker pull gkweb76/dhcp