Dockerfile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # syntax=docker.io/docker/dockerfile:1
  2. FROM mcr.microsoft.com/dotnet/aspnet:8.0
  3. # Add the MS repo to install `libmsquic` to support DNS-over-QUIC:
  4. ADD --link https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb /
  5. RUN <<HEREDOC
  6. dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
  7. # `dnsutils` added to include the `dig` command for troubleshooting:
  8. apt-get update && apt-get install -y libmsquic dnsutils
  9. apt-get clean -y && rm -rf /var/lib/apt/lists/*
  10. # `/etc/dns` is expected to exist the default directory for persisting state:
  11. # (Users should volume mount to this location or modify the `CMD` of their container)
  12. mkdir /etc/dns
  13. HEREDOC
  14. # Project is built outside of Docker, copy over the build directory:
  15. WORKDIR /opt/technitium/dns
  16. COPY --link ./DnsServerApp/bin/Release/publish /opt/technitium/dns
  17. # Support for graceful shutdown:
  18. STOPSIGNAL SIGINT
  19. ENTRYPOINT ["/usr/bin/dotnet", "/opt/technitium/dns/DnsServerApp.dll"]
  20. CMD ["/etc/dns"]
  21. ## Only append image metadata below this line:
  22. EXPOSE \
  23. # Standard DNS service
  24. 53/udp 53/tcp \
  25. # DNS-over-QUIC (UDP) + DNS-over-TLS (TCP)
  26. 853/udp 853/tcp \
  27. # DNS-over-HTTPS (UDP => HTTP/3) (TCP => HTTP/1.1 + HTTP/2)
  28. 443/udp 443/tcp \
  29. # DNS-over-HTTP (for when running behind a reverse-proxy that terminates TLS)
  30. 80/tcp 8053/tcp \
  31. # Technitium web console + API (HTTP / HTTPS)
  32. 5380/tcp 53443/tcp \
  33. # DHCP
  34. 67/udp
  35. # https://specs.opencontainers.org/image-spec/annotations/
  36. # https://github.com/opencontainers/image-spec/blob/main/annotations.md
  37. LABEL org.opencontainers.image.title="Technitium DNS Server"
  38. LABEL org.opencontainers.image.vendor="Technitium"
  39. LABEL org.opencontainers.image.source="https://github.com/TechnitiumSoftware/DnsServer"
  40. LABEL org.opencontainers.image.url="https://technitium.com/dns/"
  41. LABEL org.opencontainers.image.authors="support@technitium.com"