Skip to content

Instantly share code, notes, and snippets.

@mr-rodgers
Created January 20, 2019 11:16
Show Gist options
  • Save mr-rodgers/f57efeefb7bf3b8baea3d34a9da99cf7 to your computer and use it in GitHub Desktop.
Save mr-rodgers/f57efeefb7bf3b8baea3d34a9da99cf7 to your computer and use it in GitHub Desktop.
Dockerfile and entrypoint which will automatically flush dnsmasq when host files in the /data directory changed
#!/bin/sh
set -e
(
while inotifywait -qq -e modify /data;
do pkill -SIGHUP dnsmasq; # This asks dnsmasq to reload its config.
done
)&
dnsmasq "$@"
FROM alpine:edge
RUN apk --no-cache add dnsmasq inotify-tools
COPY ./docker-entrypoint.sh .
VOLUME /data
EXPOSE 53 53/udp
ENTRYPOINT [ "./docker-entrypoint.sh" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment