fix(shell): auto-repair DNS resolution at container startup#169
Open
konard wants to merge 3 commits intoProverCoderAI:mainfrom
Open
fix(shell): auto-repair DNS resolution at container startup#169konard wants to merge 3 commits intoProverCoderAI:mainfrom
konard wants to merge 3 commits intoProverCoderAI:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: ProverCoderAI#168
Docker's internal DNS resolver (127.0.0.11) intermittently loses its upstream nameservers, breaking domain resolution inside containers. - Add dns-repair step to entrypoint: probes github.com at startup, appends fallback nameservers (8.8.8.8, 8.8.4.4, 1.1.1.1) to /etc/resolv.conf when resolution fails - Add explicit dns configuration to docker-compose template for both main service and browser sidecar - Update example docker-compose.yml and entrypoint.sh Fixes ProverCoderAI#168 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 1185d9b.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Contributor
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Contributor
|
покрой код тестами |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Docker's internal DNS resolver (
127.0.0.11) intermittently loses its upstream nameservers, causing domain resolution to fail inside containers. This breaks git clone, package installs, and any network operations.Fixes #168
Changes
dns-repair.ts→ entrypoint template): probesgithub.comviagetent hostsat container boot; if resolution fails, appends fallback nameservers (8.8.8.8,8.8.4.4,1.1.1.1) to/etc/resolv.confdocker-compose.tstemplate): addsdns:section to both main service and browser sidecar, ensuring containers always have working external DNS regardless of Docker daemon configurationdocker-compose.ymlandentrypoint.shupdated to matchRoot cause
When Docker creates a container network, it configures
127.0.0.11as the DNS resolver in/etc/resolv.conf. This internal resolver forwards queries to the host's DNS. However, on some hosts (especially when the Docker daemon is restarted or the network stack changes), the internal resolver loses its upstream configuration, leaving containers unable to resolve any external domains.Математические гарантии
Инварианты:
∀container: startup(container) → dns_healthy(container) ∨ dns_repaired(container)∀service ∈ compose: dns(service) = [8.8.8.8, 8.8.4.4, 1.1.1.1]Предусловия:
Постусловия:
/etc/resolv.confcontains at least one working nameservergetent hosts github.comsucceeds (or warning is logged)Сложность:
O(1)per DNS probe attemptO(1)— appends at most 3 lines to resolv.confTest plan
pnpm --filter ./packages/lib typecheckpassespnpm --filter ./packages/app checkpassespnpm --filter ./packages/lib test— all 86 tests pass🤖 Generated with Claude Code