Skip to content

fix(doctor): make docker.daemon check work under Podman#7

Merged
hectorvent merged 1 commit into
mainfrom
fix/docker-daemon-podman
Jun 11, 2026
Merged

fix(doctor): make docker.daemon check work under Podman#7
hectorvent merged 1 commit into
mainfrom
fix/docker-daemon-podman

Conversation

@hectorvent

Copy link
Copy Markdown
Contributor

Summary

floci doctor's docker.daemon check reported "Docker daemon not reachable" under Podman even when the daemon was clearly up — the same run showed container.running, image.present, and endpoint.reachable all passing, and docker.socket correctly resolving the DOCKER_HOST Podman socket.

✗ docker.daemon    Docker daemon not reachable
                   Fix: Start Docker: sudo systemctl start docker
✓ docker.socket    /run/user/100033/podman/podman.sock accessible
✓ container.running  Container 'floci' is running
✓ endpoint.reachable http://localhost:4566 is reachable

Root cause

isDaemonReachable() probed with docker info --format '{{.ServerVersion}}'. .ServerVersion is a Docker-only info template field; under the podman-docker shim, podman info has 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 onlydocker info / podman info exit 0 when the daemon (or DOCKER_HOST socket) is reachable, non-zero when not — with no schema dependency. Output is discarded so the unread pipe can't fill and deadlock waitFor().

Process p = new ProcessBuilder("docker", "info")
        .redirectOutput(ProcessBuilder.Redirect.DISCARD)
        .redirectError(ProcessBuilder.Redirect.DISCARD)
        .start();
return p.waitFor() == 0;

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.version label Podman as "Docker" (and the <20.10 warning is meaningless for Podman), and fix hints say "Docker Desktop"/"systemctl start docker". Worth a separate Podman-awareness enhancement.

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().
@hectorvent hectorvent merged commit 97ab1d5 into main Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant