From 54163213f7b9969eb521f20466a7813fd4ca009b Mon Sep 17 00:00:00 2001 From: Mike Glenn <219478+ilude@users.noreply.github.com> Date: Sun, 11 Feb 2024 10:55:40 -0500 Subject: [PATCH] allow volume /etc/hosts.d to be bind mounted and read in as a hosts file --- Dockerfile | 2 +- app/templates/dnsmasq.conf.erb | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b8503f..763b12a 100755 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ LABEL maintainer="Mike Glenn " LABEL ilude-project=joyride RUN \ - mkdir -p /app /etc \ + mkdir -p /app /etc/hosts.d /etc/dnsmasq.d \ && { \ echo 'install: --no-document'; \ echo 'update: --no-document'; \ diff --git a/app/templates/dnsmasq.conf.erb b/app/templates/dnsmasq.conf.erb index 203f6fc..d51ab6d 100755 --- a/app/templates/dnsmasq.conf.erb +++ b/app/templates/dnsmasq.conf.erb @@ -2,15 +2,16 @@ no-dhcp-interface=eth0 no-resolv no-poll no-hosts -hostsdir=/etc/dnsmasq.d -keep-in-foreground +hostsdir=/etc/hosts.d +addn-hosts=/etc/dnsmasq.d/hosts +keep-in-foreground domain-needed dns-loop-detect port=54 -log-facility=- +log-facility=- <% if ENV.fetch('JOYRIDE_LOG_QUERIES', 'false').downcase.eql?('true') %> log-queries <% end %> <% if ENV.fetch('JOYRIDE_LOG_DEBUG', 'false').downcase.eql?('true') %> log-debug -<% end %> \ No newline at end of file +<% end %>