From 68fd14c7a27de9d962d8783d4c771a39188d0a55 Mon Sep 17 00:00:00 2001 From: Sam Mesterton-Gibbons Date: Mon, 11 May 2020 10:01:15 +0100 Subject: [PATCH] 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. --- Dockerfile | 5 +++++ etc/services.d/dnsmasq/run | 3 +++ 2 files changed, 8 insertions(+) create mode 100755 etc/services.d/dnsmasq/run diff --git a/Dockerfile b/Dockerfile index 4ed5aa0..bdc70ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/etc/services.d/dnsmasq/run b/etc/services.d/dnsmasq/run new file mode 100755 index 0000000..b44586b --- /dev/null +++ b/etc/services.d/dnsmasq/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +dnsmasq --no-daemon --dhcp-range=${DHCP_RANGE_START},proxy ${DNSMASQ_ARGS}