From ed54778a0d75a3dd864c8766d671076793365d94 Mon Sep 17 00:00:00 2001 From: Ken Schiano Date: Sat, 8 Aug 2026 07:36:58 -0400 Subject: [PATCH] fix: symlink /etc/dns to /config/dns at build time, drop entrypoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rm -rf the real /etc/dns dir before symlinking so it replaces rather than nests. Technitium now writes directly to the persistent addon_config mount — no entrypoint shim needed. --- technitium_dns/Dockerfile | 9 ++++----- technitium_dns/config.yaml | 2 +- technitium_dns/entrypoint.sh | 22 ---------------------- 3 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 technitium_dns/entrypoint.sh diff --git a/technitium_dns/Dockerfile b/technitium_dns/Dockerfile index 2e46ef9..04b36eb 100644 --- a/technitium_dns/Dockerfile +++ b/technitium_dns/Dockerfile @@ -1,10 +1,9 @@ -ARG BUILD_FROM=ghcr.io/hassio-addons/base:latest FROM technitium/dns-server:latest ENV DNS_SERVER_WEB_SERVICE_HTTPS_PORT=53443 \ DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS=false -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +# Technitium hardcodes /etc/dns as its config dir. HA's addon_config mounts +# at /config (persistent). Replace the real dir with a symlink so Technitium +# writes through to the persistent volume. +RUN rm -rf /etc/dns && mkdir -p /config/dns && ln -s /config/dns /etc/dns \ No newline at end of file diff --git a/technitium_dns/config.yaml b/technitium_dns/config.yaml index c5fafcc..14bc7c3 100644 --- a/technitium_dns/config.yaml +++ b/technitium_dns/config.yaml @@ -1,5 +1,5 @@ name: Technitium DNS -version: 15.4.3 +version: 15.4.4 slug: technitium_dns description: Technitium DNS Server add-on for Home Assistant arch: diff --git a/technitium_dns/entrypoint.sh b/technitium_dns/entrypoint.sh deleted file mode 100644 index 8820665..0000000 --- a/technitium_dns/entrypoint.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -set -e - -# Technitium ships /etc/dns as a real directory in the image. We need it -# to point at the persistent HA add-on config volume instead. Remove the -# directory and replace with a symlink at runtime (after HA mounts volumes). - -DATA="/config/dns" - -mkdir -p "$DATA" - -if [ -d /etc/dns ] && [ ! -L /etc/dns ]; then - # Seed: copy any existing default config into the volume on first run - if [ -z "$(ls -A "$DATA" 2>/dev/null)" ]; then - cp -a /etc/dns/. "$DATA"/ - fi - rm -rf /etc/dns -fi - -ln -sf "$DATA" /etc/dns - -exec dotnet DnsServerApp.dll \ No newline at end of file