abiosoft / abiosoft/colima

DNS is not configured during provisioning

オープン
#1,426 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
30.8k
フォーク
613
PR マージ指標
30日以内にマージされた PR はありません

説明

### Description

Since v0.9.0, when running provisioning scripts (from the templates `provisioning` section), DNS is not configured/working. At this point in time, there is no `/etc/resolv.conf` file.

Once the VM is booted, `/etc/resolv.conf` is materialized. Maybe `setupDNS` (https://github.com/abiosoft/colima/blob/main/environment/vm/lima/dns.go#L26) is called too late?

### Version

colima version 0.9.1
git commit: 0cbf719f5409ce04b9f0607b681c005d2ff7d94a

runtime: docker
arch: x86_64
client: v28.5.0
server: v28.4.0
limactl version 1.2.1
qemu-img version 10.1.0
Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers

### Operating System

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

### Output of `colima status`

INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] docker socket: unix:///Users/bas-de-laine/.colima/default/docker.sock
INFO[0000] containerd socket: unix:///Users/bas-de-laine/.colima/default/containerd.sock

### Reproduction Steps

1. Using the default template https://github.com/abiosoft/colima/blob/v0.9.1/embedded/defaults/colima.yaml, add a provisioning step to check whether `/etc/resolv.conf` exists and whether it is possible to resolve `github.com`:

```
provision:
- mode: system
script: |
#!/usr/bin/env bash
{
printf "Checking whether /etc/resolv.conf exists\n\n"
[ -f /etc/resolv.conf ] && printf "🟢 /etc/resolv.conf exists\n" || printf "🔴 /etc/resolv.conf is missing\n"
printf "\nCalling getent ahosts github.com\n\n"
getent ahosts github.com
} > /Users/bas-de-laine/colima_resolv_conf_is_present.txt
```
2. put the template in `~/.colima/_templates/default.yaml`
3. create the vm `COLIMA_PROFILE=default colima start --template`

### Expected behaviour

I expect DNS to work when provisioning scripts run.

### Additional context

_No response_

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

The issue points to environment/vm/lima/dns.go and the setupDNS function. Start by examining the Lima VM provisioning sequence to see when DNS is configured relative to script execution. Check the provisioning scripts in the templates. Reproduce the issue locally with the provided steps to confirm the missing /etc/resolv.conf. The fix likely involves adjusting the timing of DNS setup during VM initialization.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, go, shell
領域
cli, devops, networking
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。