Resolve dns of `host.docker.internal` to vm's reachable IP
- Lenguaje dominante
- Go
- Estrellas
- 30.8k
- Forks
- 613
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Description
Since v0.5.0 it is possible to add `--network-address` to create an IP that is reachable from both the vm and the macOS host.
It would be great, if like at Docker Desktop on the macOS host the dns `host.docker.internal` resolves to that (reachable) IP (in my case 192.168.106.2).
#### Why?
I'd like to attach to a node debugging process that is running inside of the container, from Visual Studio Code. I already binded port 9229 to 0.0.0.0, but it's still inaccessible from the macOS host when attaching to localhost:9229. When I attach to 192.168.106.2, it just works like a charm. With docker desktop I previously used `host.docker.internal` in some of these cases.
_UPDATE: After updating to v0.5.2 and a colima stop; colims start `localhost` is also working again, but I think it's still helpful to have a resolvable `host.docker.internal` from macOS like in Docker Desktop_
#### Current behaviour
Inside the vm the dns name `host.docker.internal` is already resolved to one of the vm's IPs, but not the (new) accessible.
```sh
➜ ~ colima ssh
ping host.docker.internal
PING host.docker.internal (192.168.5.2)
64 bytes from 192.168.5.2: icmp_seq=0 ttl=64 time=0.450 ms
exit
➜ ~ ping 192.168.5.2
PING 192.168.5.2 (192.168.5.2): 56 data bytes
Request timeout for icmp_seq 0
```
#### Expected behaviour
```sh
➜ ~ colima ssh
ping host.docker.internal
PING host.docker.internal (192.168.106.2)
64 bytes from 192.168.106.2: icmp_seq=0 ttl=64 time=0.450 ms
exit
➜ ~ ping 192.168.106.2
PING 192.168.106.2 (192.168.106.2): 56 data bytes
64 bytes from 192.168.106.2: icmp_seq=0 ttl=64 time=0.450 ms
```
#### Workaround
Add the reachable IP into `/etc/hosts`
```
192.168.106.2 host.docker.internal
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.