-
Notifications
You must be signed in to change notification settings - Fork 288
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
host.docker.internal not resolving from inside a container to Windows 10 host. #12673
Comments
Hi @anwiednn I had the same issue and when I came here to report it, you've already done so. So I stopped updating Docker Desktop and I told everyone on my team to do the same. We rolled back to 4.5.1. Today I bumped the version to 4.8.2 and it seems fixed. |
Thanks @gabrieloshiro for your message. I was able to resolve the issue as well. Instead of rolling back my docker version, I updated the usage of my various docker containers and integrated those into a docker-compose env, creating it's of network and therefore not requiring to usage of |
I just tried in version 4.9.1 and the bug is still present. |
I have the same problem in Docker Desktop 4.11.1 (84025). After some random while, the host.docker.internal stops responding inside containers. Does anyone have a workaround, other than restarting the docker stack? |
PS: It does 'come up' after it has been down for some while again; very strange. |
@adrouard @MetinSolmaz I had the same experience, that after a period of inactivity it stopped working and at times came back alive again. Not really a work around, but I used docker-compose to setup my various containers in the same network and therefore was not reliant anymore on host.docker.internal. |
I think I am seeing a similar behavior using my own hostname (on my dev machine I tend to do that since it is a laptop and I could be on wifi or I could be hardlined). Sometimes the deployed apis I have using my dev hostname resolve and sometimes they don't. It sounds exactly like the behavior you are describing wtih docker.host.internal and could be that docker's problem is not that one resolve but an internal dns problem in general. |
Hi @clemp6r, Yes it does look like the same problem I have experienced. Cheers |
Using docker-desktop 4.12, after rebooting the machine I can ping |
Experiencing the same issue. Usually I solve it with |
@kraljs, thanks for your comment. I can use this technique to renew my |
Still the same issue in 4.15.0. However I've found a workaround. If you have a static ip to the localhost server, you can create your own host name. Replace wherever you would use host.docker.internal. Just make sure the host name is all lowercase or some containers might not resolve it. Downside is that if the ip address change, you have to update the docker compose file. |
Same issue, worked fine on WSL, now it is not resolvable at all |
I have the same issue now, running 4.15.0. |
same issue here, also also switched to hyper-v but that didnt do the trick either |
Same here, but I'm quite sure that it was working before. I suspect that maybe windows update broke it, but I don't know how to confirm that. At this moment this options don't work for me at Windows 11 pro,
All of them works on Windows 10 pro |
this works for me
|
This worked for me too! Thanks!
|
This works for me too. A bit of a pain - any idea of when this will be fixed ? Its the same on windows 11 prof and docker 4.17.0 |
jesus fcking christ thank you I spent WAY more time than I'd like to admit combatting this issue EDIT: the one liner powershell version: |
Thank you so much |
Same issue shown in v4.18.0 its not resolved, you can downgrade to 4.16.3. !!! |
It's been a few months since I used host.docker.internal and I experiencing the issue in 4.22.1 (118664) on Win 11. |
Still a favorite |
I had this issue (not on Windows, but on Mac), when I specified DNS settings for Docker. After removing them, host.docker.internal was working again. |
Hi @zaiddabaeen, I have the same issue as you right now. I got the following error when I run the "docker-compose up" Could you show me what you did in detail how to solve this? |
@zaiddabaeen, Great observation, finding and share! On windows, I also found dns settings in |
I'm facing this issue in MacBook Air m1. Can you please help. I just started learning docker |
I also came here from a Mac... host.docker.internal was working with my setup the day before, but stopped working now... My issue turned out to be that I needed to run Maybe this helps someone else running into this down the line. |
DEBIAN
|
Same issue here, MacOS X 14.4.1 |
For Googlers coming here, the answer helps to resolve the issue - #12673 (comment) I added the following to my
|
Actual behavior
host.docker.internal
not resolving from inside the docker container at times. However resolving at other times. Please see output in sectionSteps to reproduce the behavior
Expected behavior
host.docker.internal
resolving from inside the docker container to Windows host.Information
Windows Version:
Docker Desktop Version:
WSL2 or Hyper-V backend?
Hyper-V installed
Are you running inside a virtualized Windows e.g. on a cloud server or a VM:
No
Output of
& "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check
Steps to reproduce the behavior
host.docker.internal
orgateway.docker.internal
.192.168.14.54
host.docker.internal
The text was updated successfully, but these errors were encountered: