dind passthrough: warn when DIND_HOST_PASSTHROUGH_IMAGES is set but no host socket is mounted (issue #102)#103
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #102
…socket is mounted (issue #102) Running box-dind with passthrough enabled (default `public`) and an explicit allowlist (`DIND_HOST_PASSTHROUGH_IMAGES=...`) but without the host Docker socket bind-mounted was a silent no-op: the entrypoint copied nothing, printed nothing, and the first nested `docker run` re-pulled the full image from the registry with no hint why. Downstream this silently re-pulled a 30+ GB image because of a forgotten `-v` flag (link-assistant/hive-mind#1914). A non-empty `DIND_HOST_PASSTHROUGH_IMAGES` is an unambiguous opt-in signal, so `passthrough_host_images` now emits one actionable warning in exactly that case — enabled passthrough + allowlist set + no socket mounted — naming the missing `-v /var/run/docker.sock:${DIND_HOST_DOCKER_SOCK}:ro` mount. The present-but-unreachable socket path already warned and still wins (its more specific message fires first); plain box-dind containers that never set an allowlist stay silent so the default mode is not spammed. Covered by new unit cases (8b/8c) in experiments/preload-unit-test.sh and an integration case in tests/dind/example-preload-images.sh; documented in docs/dind/USAGE.md. Adds a patch changeset.
Working session summaryDone. Here's a summary of what I did for issue #102. Root causeIn FixAdded one
Tests (reproduce → fix)
Docs / release
PR #103 is updated, marked ready, and pushed: #103 The integration test will exercise the change in CI ( This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (2.9K new + 54.0K cache writes + 1.7M cache reads) input tokens, 13.8K output tokens, $1.531006 cost 🤖 Models used:
📎 Log file uploaded as Gist (1067KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Fixes #102.
When
box-dindruns with host-image passthrough enabled (the defaultDIND_HOST_PASSTHROUGH=public) and an explicit allowlist set(
DIND_HOST_PASSTHROUGH_IMAGES=...) but the host Docker socket is notbind-mounted, passthrough was a silent no-op: nothing was copied, nothing
printed, and the first nested
docker runre-pulled the full image from theregistry with no hint why. A non-empty allowlist is an unambiguous opt-in
signal, so a missing socket is almost certainly a misconfiguration worth
surfacing.
Downstream this silently re-pulled a 30+ GB image because of a forgotten
-vflag (link-assistant/hive-mind#1914).Change
passthrough_host_imagesinubuntu/24.04/dind/dind-entrypoint.shnow emits asingle actionable warning in exactly the opt-in case — enabled passthrough +
allowlist set + no socket mounted — naming the missing mount:
Behavior preserved:
more specific "not accessible" message fires first).
box-dindcontainers that never set an allowlist stay silent whenno socket is mounted, so the default mode is not spammed.
Reproduce
Tests
experiments/preload-unit-test.sh): new Case 8b (allowlist +absent socket → warning naming the var and the
-vremediation) andCase 8c (present-but-unreachable socket still wins; the missing-mount hint
is suppressed). Existing Case 8 still asserts plain mode stays silent.
RESULT: 46 passed, 0 failed.tests/dind/example-preload-images.sh): new case starts aconsumer with
DIND_HOST_PASSTHROUGH_IMAGESset but no-vsocket mountand asserts the warning appears in the container logs.
Docs / release
docs/dind/USAGE.md: documents the opt-in warning under theDIND_HOST_PASSTHROUGH_IMAGESscoping section.patchchangeset (.changeset/issue-102-passthrough-missing-socket-warning.md)..gitkeepplaceholder.