From a035fc086139468d03dc143ac0e6fb5fff0db941 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 16 Dec 2025 16:53:56 -0600 Subject: [PATCH] Try `10.0.2.2` for self-hosted GitHub runners c.f. `DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns` and `DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false` > rootless: Add support for enabling host loopback by setting the `DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK` environment variable to `false` (defaults to `true`). This lets containers connect to the host by using IP address 10.0.2.2. [moby/moby#47352](https://github.com/moby/moby/pull/47352) > > _-- https://docs.docker.com/engine/release-notes/26.0/_ > ``` > # * DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=(true|false): prohibit connections to 127.0.0.1 on the host (including via 10.0.2.2, in the case of slirp4netns). Defaults to "true". > ``` > > *-- https://github.com/moby/moby/blob/b649e272bb0253fe766069966416b9330a2e38c0/contrib/dockerd-rootless.sh#L18* --- internal/docker/deployer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/docker/deployer.go b/internal/docker/deployer.go index 0a8a511a..3430691a 100644 --- a/internal/docker/deployer.go +++ b/internal/docker/deployer.go @@ -348,7 +348,7 @@ func deployImage( // interact with a complement-controlled test server. // Note: this feature of docker landed in Docker 20.10, // see https://github.com/moby/moby/pull/40007 - extraHosts = []string{"host.docker.internal:host-gateway"} + extraHosts = []string{"host.docker.internal:10.0.2.2"} } for _, m := range cfg.HostMounts {