Start dnsmasq as a system service

Adds a service startup file for dnsmasq to run when the container
starts.
Also adds an environment variable to allow DHCP range to be overridden.
This commit is contained in:
Sam Mesterton-Gibbons 2020-05-11 10:01:15 +01:00
parent c44ae324c9
commit 68fd14c7a2
2 changed files with 8 additions and 0 deletions

View file

@ -5,3 +5,8 @@ RUN apk add --update dnsmasq
# Copy config files for dnsmasq, and running as a service
COPY etc /etc/
# Set the start of the IP range to reply to PXE DHCP requests on
ENV DHCP_RANGE_START=192.168.0.1
# dnsmasq will be started as a system service by the s6 supervisor

3
etc/services.d/dnsmasq/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
dnsmasq --no-daemon --dhcp-range=${DHCP_RANGE_START},proxy ${DNSMASQ_ARGS}