From 9da0f4dfa579d4109f55efebc203a3c437f9880a Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sun, 22 Mar 2026 11:51:38 +0100 Subject: [PATCH] Fix e2e host gateway resolution in Docker on Linux Add --add-host flag to container run commands so that the host gateway hostname resolves correctly. Docker on Linux (e.g. GitHub Actions) does not automatically add host.docker.internal to /etc/hosts unlike Docker Desktop or Podman. Co-Authored-By: Claude Opus 4.6 --- test/e2e/e2e_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 89e4037..aa26ae6 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -133,7 +133,9 @@ func startPkgproxy(t *testing.T, port int, cacheDir string) { func runContainer(t *testing.T, image string, mounts []string, cmdArgs []string) { t.Helper() - args := []string{"run", "--rm"} + args := []string{"run", "--rm", + "--add-host", hostGateway + ":host-gateway", + } for _, m := range mounts { args = append(args, "-v", m) }