From eb09a417a16cd04b1cb2a78ac973713a230e68e4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 20:28:12 +0800 Subject: [PATCH] Fix DNS resolution failures in Alpine containers by setting ndots:0 (#2827) * Initial plan * Fix DNS resolution issue in Alpine containers by adding ndots:0 option Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --- docker/docker-entrypoint.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 272c001f..1959231e 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -17,6 +17,16 @@ log_with_style() { printf "\n[%s] [%7s] %s\n" "${timestamp}" "${level}" "${message}" } +# Fix DNS resolution issues in Alpine Linux +# Alpine uses musl libc which has known DNS resolver issues with certain domains +# Adding ndots:0 prevents unnecessary search domain appending +if [ -f /etc/alpine-release ]; then + if ! grep -q "^options ndots:0" /etc/resolv.conf 2>/dev/null; then + echo "options ndots:0" >> /etc/resolv.conf + log_with_style "INFO" "🔧 已配置 DNS 解析优化 (ndots:0)" + fi +fi + log_with_style "INFO" "🚀 1. 检测配置文件..." load_ql_envs export_ql_envs