fix(doctor): make docker.daemon check work under Podman#7
Merged
Conversation
isDaemonReachable() probed the daemon with 'docker info --format
{{.ServerVersion}}', a Docker-only template field. Under the podman-docker shim
'podman info' has no .ServerVersion, so the template errors and exits non-zero —
a false 'Docker daemon not reachable' even while containers run fine via the
DOCKER_HOST socket. Probe by exit code instead (docker/podman info exit 0 when
reachable) and discard output to avoid a pipe-buffer deadlock on waitFor().
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.
Summary
floci doctor'sdocker.daemoncheck reported "Docker daemon not reachable" under Podman even when the daemon was clearly up — the same run showedcontainer.running,image.present, andendpoint.reachableall passing, anddocker.socketcorrectly resolving theDOCKER_HOSTPodman socket.Root cause
isDaemonReachable()probed withdocker info --format '{{.ServerVersion}}'..ServerVersionis a Docker-onlyinfotemplate field; under thepodman-dockershim,podman infohas no such field, so the template errors and exits non-zero → false "not reachable". (The reported "Docker 5.8.2" is Podman's version, confirming the shim.)Fix
Probe reachability by exit code only —
docker info/podman infoexit0when the daemon (orDOCKER_HOSTsocket) is reachable, non-zero when not — with no schema dependency. Output is discarded so the unread pipe can't fill and deadlockwaitFor().Testing
mvn test— 33 passing. (Daemon reachability is integration-only; no unit test added.)Follow-up (not in this PR)
Cosmetic Podman gaps remain:
docker.installed/docker.versionlabel Podman as "Docker" (and the<20.10warning is meaningless for Podman), and fix hints say "Docker Desktop"/"systemctl start docker". Worth a separate Podman-awareness enhancement.