fix: route DMR through the selected Docker connection safely - #4481
Merged
Merged
Conversation
dgageot
force-pushed
the
worktree-board-14182803df41cd7e
branch
from
September 30, 2026 06:11
6868892 to
bbde8ab
Compare
Discovery, status, inspect, and pull now go through `docker system dial-stdio` for whatever context/host the CLI resolved, instead of a hardcoded local socket, and the API server keeps that connection on its request context. Config/TLS/socket paths are anchored and the effective context is pinned before --working-dir changes the process directory, and we stop offering to delete local partial downloads when the connection may be remote. Also fixes the TLS-flag-forwarding test to use a native temp dir for the cert/key paths instead of hardcoded absolute paths, so it passes on any platform. Assisted-By: docker-agent Signed-off-by: David Gageot <david.gageot@docker.com>
dgageot
force-pushed
the
worktree-board-14182803df41cd7e
branch
from
September 30, 2026 06:12
bbde8ab to
eb71147
Compare
trungutt
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DMR (Docker Model Runner) commands were resolving the CLI connection independently for discovery, status, inspect, and pull, instead of reusing the context/host/config/TLS settings the root command already selected. On Docker Desktop that selection can point at a remote engine reached through
docker system dial-stdio, so falling back to a hardcoded local socket silently talked to the wrong daemon, and the effective context could also drift if it were re-resolved after--working-dirchanged the process directory.This change threads the resolved connection through the DMR code paths: discovery, status, inspect, and pull now issue
docker system dial-stdiofor whatever context/host the CLI picked, and the API server carries that connection on its request context so it stays stable across reconnects rather than being re-derived per request. Config, TLS, and socket paths are anchored to absolute locations before use, and the effective context is pinned early, before--working-dircan change the working directory out from under later resolution. As a side effect, we stop offering to delete local partial downloads when the connection may be remote, since that partial file belongs to a different engine and deleting it would be unrelated cleanup at best.Coverage:
task dev(build, full test suite, lint) passed, plus a targeted race run,go test -race ./cmd/root -run '^TestDMR' -count=1. New regression tests exercise the connection propagation incmd/root/dmr_test.go,pkg/model/provider/dmr/dmrmodels/resolve_test.go,pkg/model/provider/dmr/pull_test.go, andpkg/server/server_test.go, anddocs/providers/dmr/index.mddocuments the new behavior. This has been validated locally and with automated tests only; live reproduction against Docker Desktop 4.93 has not been verified, so I can't yet confirm the original symptom is 100% reproduced or resolved in that setup.