fix: persist config across restarts
- root cause: Technitium image ships /etc/dns as a real directory, so the build-time 'ln -sf /data/dns /etc/dns' created the symlink INSIDE it (/etc/dns/dns) instead of replacing it. Technitium kept writing to the ephemeral container directory and lost everything on restart. - fix: add entrypoint.sh that runs at container start (after HA mounts volumes), removes the real /etc/dns dir, and symlinks it to /config/dns (the persistent addon_config mount). Seeds defaults on first run only. - bump version to 15.4.2
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
ARG BUILD_FROM=ghcr.io/hassio-addons/base:latest
|
ARG BUILD_FROM=ghcr.io/hassio-addons/base:latest
|
||||||
FROM technitium/dns-server:latest
|
FROM technitium/dns-server:latest
|
||||||
|
|
||||||
ENV DATA_DIR="/data/dns" \
|
ENV DNS_SERVER_WEB_SERVICE_HTTPS_PORT=53443 \
|
||||||
DNS_SERVER_WEB_SERVICE_HTTPS_PORT=53443 \
|
|
||||||
DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS=false
|
DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS=false
|
||||||
|
|
||||||
RUN mkdir -p /data/dns && \
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
ln -sf /data/dns /etc/dns
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT []
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["dotnet", "DnsServerApp.dll"]
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name: Technitium DNS
|
name: Technitium DNS
|
||||||
version: 15.4.0
|
version: 15.4.2
|
||||||
slug: technitium_dns
|
slug: technitium_dns
|
||||||
description: Technitium DNS Server add-on for Home Assistant
|
description: Technitium DNS Server add-on for Home Assistant
|
||||||
arch:
|
arch:
|
||||||
|
|||||||
22
technitium_dns/entrypoint.sh
Normal file
22
technitium_dns/entrypoint.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/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
|
||||||
Reference in New Issue
Block a user