From 3e7b81e7e77ee0cd9fde17c0f467508183779c8c Mon Sep 17 00:00:00 2001 From: didericis Date: Tue, 12 May 2026 10:40:41 -0400 Subject: [PATCH] test(dry-run): pin DOCKER_HOST so HOME override works on Desktop The test overrides HOME to isolate the manifest under test from the dev's real ~/claude-bottle.json. On Docker Desktop that override also breaks docker CLI endpoint resolution, since the active context is read from $HOME/.docker/config.json and the per-user socket lives under $HOME/.docker/run/docker.sock. Forward the parent's resolved endpoint via DOCKER_HOST so the subprocess reaches the same daemon regardless of $HOME. Co-Authored-By: Claude Opus 4.7 --- tests/integration/test_dry_run_plan.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/test_dry_run_plan.py b/tests/integration/test_dry_run_plan.py index fd8014f..0a0009c 100644 --- a/tests/integration/test_dry_run_plan.py +++ b/tests/integration/test_dry_run_plan.py @@ -34,6 +34,20 @@ class TestDryRunPlan(unittest.TestCase): env = os.environ.copy() env["HOME"] = str(work_dir) env.pop("CLAUDE_BOTTLE_DRY_RUN", None) + # The HOME override above isolates the manifest under test + # from the dev's real ~/claude-bottle.json. On Docker Desktop + # that same override breaks docker CLI endpoint resolution, + # since the active context lives in $HOME/.docker/config.json + # and the per-user socket sits under $HOME/.docker/run/. + # Pin DOCKER_HOST to the parent's resolved endpoint so the + # subprocess reaches the same daemon regardless of $HOME. + endpoint = subprocess.run( + ["docker", "context", "inspect", + "--format", "{{.Endpoints.docker.Host}}"], + capture_output=True, text=True, check=True, + ).stdout.strip() + if endpoint: + env["DOCKER_HOST"] = endpoint result = subprocess.run( [ sys.executable, str(REPO_ROOT / "cli.py"),