abiosoft / abiosoft/colima

colima ignores template's DNS config

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

Descrizione

### Description

I was getting these errors when trying to start a docker container:

```
failed to solve: redis:7: failed to resolve source metadata for docker.io/library/redis:7: failed to do request: Head "https://registry-1.docker.io/v2/library/redis/manifests/7": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: no such host
```

So I went into `colima template`, changed `network.dns` to `8.8.8.8`, `8.8.4.4`, then ran `colima restart`

```yaml
# Network configurations for the virtual machine.
network:
# Custom DNS resolvers for the virtual machine.
#
# EXAMPLE
# dns: [8.8.8.8, 1.1.1.1]
#
# Default: []
dns:
- 8.8.8.8
- 8.8.4.4

```

I've run `colima restart`, `colima stop`, `colima start`, etc.

Nothing worked, I got exactly the same error message every time

```
failed to solve: redis:7: failed to resolve source metadata for docker.io/library/redis:7: failed to do request: Head "https://registry-1.docker.io/v2/library/redis/manifests/7": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: no such host
```

Which was surprising, because 127.0.0.53 is not in my `/etc/resolv.conf`, it's not in my `scutil --dns`, and it's not in my `colima template`! (I double checked several times, `colima template` was not getting reset or anything)

However, when I ran

```
colima stop
colima start --dns=8.8.8.8,8.8.4.4

```

The issue finally resolved.

I guess this means that `colima template`'s DNS configurations are being ignored. Only the command-line flag works.

### Version

colima version 0.8.0
git commit: 9c08cff339f087c0600d9d56af7b5fbcfe02e287

runtime: docker
arch: aarch64
client: v27.3.1
server: v27.3.1
limactl version 1.0.1

### 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 is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/me/.colima/default/docker.sock

### Reproduction Steps

1. Change `dns` values in `colima template`
2. `colima restart`
3.

### Expected behaviour

docker will use the template-specified DNS servers

### 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.