-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localhost is resolved to ::1
(IPv6) instead of 127.0.0.1
#7269
Comments
cc @djs55 |
Hi every one, I'm facing the same issue as GuLinux since last update :-( |
Thank you for the nice clear report and examples - I think I see what's happening. To give some background ... In earlier releases, the Docker engine would only enable IPv6 on the loopback interface when a container was connected to an IPv6-enabled network. When it was disabled, there was no But, the That DNS response for an absent As part of ongoing work to improve Docker's support for IPv6 - by default, we now leave IPv6 enabled on the loopback interface, so it always has a So ... I think the change you're seeing is probably because If the In which case, there are a couple of options ... If the healthcheck only works on IPv4, it would probably be best to change the healthcheck URL to Alternatively, you can disable IPv6 in the container so that it never has a Hopefully that makes sense, and helps? Let me know! |
Hi, thank you for your reply. Yes, I thought of using |
The Editing the The change is that the loopback interface now keeps the Explicitly using the IPv4 address for an IPv4-only service will always work. The old behaviour, no |
Thanks, if that's the case, we'll start using |
Hi you all, 👍 |
Facing the same issue here. This broke some automation of ours and we lost hours of time to debugging. |
Description
Since upgrading to docker desktop v4.29.0, we've noticed that the host resolution for
localhost
is resolving to the IPv6 version (::1
) instead of IPv4 (127.0.0.1
).Specifically, with a
nslookup
I can notice that the order of IPv4 and IPv6 resolution is inverted, and in v4.29.0 the latter is prioritised.This is not mentioned in the changelog, so I assume it's a bug, especially since IPv6 networks are not supported on Docker for Mac.
In our environment services start with IPv4 stack, so having healthcheck calls to
http://localhost/status
result to the containers status being "unhealthy".Reproduce
Expected behavior
localhost should resolve to the IPv4 address (
127.0.0.1
)docker version
Client: Cloud integration: v1.0.35+desktop.13 Version: 26.0.0 API version: 1.45 Go version: go1.21.8 Git commit: 2ae903e Built: Wed Mar 20 15:14:46 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.29.0 (145265) Engine: Version: 26.0.0 API version: 1.45 (minimum version 1.24) Go version: go1.21.8 Git commit: 8b79278 Built: Wed Mar 20 15:18:02 2024 OS/Arch: linux/arm64 Experimental: true containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
1947FF30-F1E0-456C-A352-91A4B412F253/20240501082456
Additional Info
No response
The text was updated successfully, but these errors were encountered: