Add host.docker.internal to ContainerMetadataFetcher list of approved hosts
See original GitHub issueContainerMetadataFetcher
currently allows three hosts for container metadata endpoints: 169.254.170.2, localhost, and 127.0.0.1. However, neither localhost or 127.0.0.1 represent the local docker host. Instead, the host’s localhost is reachable as host.docker.internal (docs). On Linux, the workaround is to use --network host
, but on Mac and Windows this doesn’t work (the docker network is always isolated from the host).
host.docker.internal should be added to ContainerMetadataFetcher
’s list of approved hosts, so that a custom metadata endpoint for testing can be run on the host rather than needing to be run in another container.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to connect to the Docker host from inside a ...
As of Docker version 18.03, you can use the host.docker.internal hostname to connect to your Docker host from inside a Docker container.
Read more >What is the equivalent of --add-host=host.docker.internal ...
The actual Docker Compose equivalent is achieved by appending the same string to the extra_hosts parameters (#Doc) as:
Read more >Host.docker.internal seems doesnt work with CI/CD Github ...
Hello everyone, im new here and using docker. We are developing an app and we need to use a subgraph, so the community...
Read more >Traefik Docker Documentation
try a lookup of host.docker.internal; if the lookup was unsuccessful, ... be provided as an extra_host to the Traefik container, using the --add-host...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have solved this for now in my
aws-export-credentials
tool by providing an IMDSv2-compatible endpoint; the IMDS endpoint is not subject to the same host checks. I think this issue still stands, though.I should note that in addition to aws-export-credentials I made a single-purpose implementation in Go: imds-credential-server
But I’d love to see this host supported in all SDKs