Open alan-czajkowski opened 4 years ago
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
I have the same problem!
This works on Docker Desktop Windows but not on Docker Desktop Mac.
Would be great to be able to use host.docker.internal
for an OS independent development...
Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30 days of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/lifecycle frozen
@alan-czajkowski Not sure about your use case but I just tested a container in Docker for Mac and although the host.docker.internal
is not present in /etc/hosts
the actual address is resolved.
When I curl host.docker.internal
I'm getting a response from the webserver running on the host.
I think another issue here is that services that expose themselves specifically to 127.0.0.1
are not going to be accessible when accessed by the IP resolved via host.docker.internal
without the /etc/hosts
entry.
In my case, I have a local mysql
server instance that is exposed on localhost only and cannot be accessed by the service running in docker hitting host.docker.internal
without the /etc/hosts
entry.
Hello,
I encountered the same problem: we are working on Windows and Mac OSes and have inconsistencies due to host.docker.internal
being accessible on Windows, but not on macOS. Looking at /etc/hosts
though, there is an alias defined for kubernetes.docker.internal
instead.
I had the same problem on MacOS
Same problem. Wish we could use the same settings on Windows and Mac.
Some related reading at https://github.com/docker/for-mac/issues/2965
Expected behavior
Docker Desktop adds the following entry to
/etc/hosts
:similarly to how it already adds the following entry:
Actual behavior
Docker Desktop does not add the
host.docker.internal
entry into/etc/hosts
.Information
host.docker.internal
, when those same services are run in developer/debug mode on the host itself (not in a container) the configuration should not break the service, hence the/etc/hosts
entryhost.docker.internal
Diagnostic logs
Steps to reproduce the behavior
host.docker.internal
and then try to run the same service on the host and it will fail because of the missing/etc/hosts
entry