abiosoft / abiosoft/colima

Short form entry from /etc/hosts is not resolved

Aperta
#895 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
regression
Lingua principale
Go
Stelle
30.8k
Fork
613
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Description

Short form entries from the host `/etc/hosts` were resolvable but I upgraded the version (don't remember what I had before) and the resolving broke.

### Version

colima version 0.6.2
git commit: 22d7e5fbc86d5b8e3b27065a762800bc7960a0ff
limactl version 0.18.0
qemu-img version 8.1.2

### Operating System

- [ ] macOS Intel <= 13 (Ventura)
- [ ] macOS Intel >= 14 (Sonoma)
- [ ] Apple Silicon <= 13 (Ventura)
- [X] Apple Silicon >= 14 (Sonoma)
- [ ] Linux

### Output of `colima status`

INFO[0000] colima [profile=m1] is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/andriy.slobodyanyk/.colima/m1/docker.sock

### Reproduction Steps

I have `192.168.5.2` at the host `/etc/hosts` file.
```
❯ grep oracle /etc/hosts
192.168.5.2 oracle
```
and
```
network:
address: false
dns: []
dnsHosts:
example.com: 1.2.3.4
oracle: 192.168.5.2
```
at the `.colima/m1/colima.yaml`

I would like to resolve the `oracle` name within the container.

It works if there is no internal network
`docker run -it --rm arm64v8/alpine getent hosts example.com oracle`
```
1.2.3.4 example.com example.com
192.168.5.2 oracle oracle
```
also I noticed that
`docker run -it --rm arm64v8/alpine cat /etc/resolv.conf`
```
nameserver 192.168.5.2
```

However, if there is some internal network (I have one because this setup is used not only locally)
`docker network create some_network`

the behaviour is different. `oracle` is not resolved anymore.
`docker run -it --rm --network some_network arm64v8/alpine getent hosts example.com oracle`
```
1.2.3.4 example.com example.com
```
Still, any FQDN with dots from the `/etc/hosts` like `a.b.com` is resolved well.

The nameserver is also different
`docker run -it --rm --network some_network arm64v8/alpine cat /etc/resolv.conf`
```
nameserver 127.0.0.11
options edns0 trust-ad ndots:0
```

### Expected behaviour

It would be really nice to have a possibility to resolve `oracle` again i.e.
`docker run -it --rm --network some_network arm64v8/alpine getent hosts oracle`

For the moment the only workaround I have is to add
```
extra_hosts:
- oracle:192.168.5.2
```
to the `docker-compose` and not to commit the change.

### Additional context

_No response_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.