-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
( | |
while inotifywait -qq -e modify /data; | |
do pkill -SIGHUP dnsmasq; # This asks dnsmasq to reload its config. | |
done | |
)& | |
dnsmasq "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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