Skip to content

Commit 8032ed9

Browse files
authored
Merge pull request #837 from crazy-max/lima-dns
docker(install): don't use local system resolver with lima and increase timeouts
2 parents efa21ec + 3588cc8 commit 8032ed9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/docker/assets.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,25 @@ probes:
293293
#!/bin/bash
294294
set -eux -o pipefail
295295
# Don't check for docker CLI as it's not installed in the VM (only on the host)
296-
if ! timeout 30s bash -c "until pgrep dockerd; do sleep 3; done"; then
296+
if ! timeout 60s bash -c "until pgrep dockerd; do sleep 3; done"; then
297297
echo >&2 "dockerd is not running"
298298
exit 1
299299
fi
300300
hint: See "/var/log/cloud-init-output.log". in the guest
301301
302302
hostResolver:
303+
# Don't use local system resolver
304+
enabled: false
303305
# hostResolver.hosts requires lima 0.8.3 or later. Names defined here will also
304306
# resolve inside containers, and not just inside the VM itself.
305307
hosts:
306308
host.docker.internal: host.lima.internal
307309
310+
# Use custom DNS servers instead of the host's DNS settings
311+
dns:
312+
- 1.1.1.1
313+
- 1.0.0.1
314+
308315
portForwards:
309316
- guestSocket: "/var/run/docker.sock"
310317
hostSocket: "{{dockerSock}}"

src/docker/install.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export class Install {
331331
};
332332

333333
await core.group('Starting lima instance', async () => {
334-
const limaStartArgs = ['start', `--name=${this.limaInstanceName}`];
334+
const limaStartArgs = ['start', `--name=${this.limaInstanceName}`, `--timeout=15m`];
335335
if (process.env.LIMA_START_ARGS) {
336336
limaStartArgs.push(process.env.LIMA_START_ARGS);
337337
}

0 commit comments

Comments
 (0)