abiosoft / abiosoft/colima

colima ignores template's DNS config

Abierto
#1,219 12 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
30.8k
Forks
613
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

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.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.