fix(doctor): probe podman too — a Podman machine was reported as "docker is not installed" - #131
Merged
Merged
Conversation
…ker is not installed"
doctor.sh advertised Podman in its advice text ("Rancher Desktop or Podman
(docker-CLI compatible) ... are common substitutes") while every probe in the
section ran docker only: `docker info`, the `command -v docker` gate, the
not-installed warning, and a start hint that said `open -a Docker`. A machine
running Podman without the docker shim is fully able to run the container lane,
and doctor told it it had nothing. On a team that cannot licence Docker Desktop
that reads as "go install software you are not allowed to have" — one
colleague's machine-ready status carried "Docker not installed" as a known
issue; they may well have had Podman all along. Same defect class as #128: an
instrument reporting a problem that does not exist.
Detection and reporting only. `mxcli docker check` is mxcli's own code in
another repo and is untouched; this change only makes doctor report what is
actually on the machine.
- CONTAINER_RUNTIME: docker when present (including when it is a Podman shim —
transparent and correct), else podman. MXTK_CONTAINER_RUNTIME=<name> forces one.
- The runtime is named in the output: "podman responding — ..." vs
"docker daemon responding — ...". Podman normally has no daemon, so the label
carries that difference rather than inventing a "podman daemon".
- container_daemon_up keeps the existing bounded background/poll/kill probe and
its exit contract (0 up / 1 down / 2 no answer within the bound) for both
runtimes — a stopped `podman machine` stalls exactly like a stopped Docker
Desktop, which is what the bound exists for.
- container_start_hint: `podman machine start` on macOS/Windows,
`systemctl --user start podman.socket` on Linux/WSL, instead of sending a
Podman user to open Docker Desktop.
- The not-installed warning now names both and presents Podman as the
licence-free option rather than implying Docker Desktop is required.
- --install still auto-launches Docker Desktop on macOS only; podman is left
alone, because `podman machine start` with no machine ever initialised is not
a safe guess to make on someone's behalf.
NOT field-run: this container has no working container runtime, so every branch
was exercised against fake `docker`/`podman` binaries on PATH (up, down,
hanging, absent, podman-only), not against a real one. The run that would prove
it: on a Mac with Podman installed and no `docker` on PATH, `bin/doctor.sh`
should print "podman responding" (or a podman start hint) instead of "docker is
not installed".
bash -n clean; bin/check-portability.sh clean (163 files).
tests/wave2/test-doctor-docker-probe.sh not run — its four scenarios were
replicated by hand against the changed script and all of its grep strings
reproduce verbatim.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0187r9bQWkZAEppyEqrDevjK
…n-probe # Conflicts: # CHANGELOG.md
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.
Direct lane (
bin/)What changed and why (one paragraph):
bin/doctor.shadvertised Podman in its advice text — "Rancher Desktop or Podman (docker-CLI compatible) and colima (macOS) are common substitutes" — while every probe in the section randockeronly:docker_daemon_up()randocker info, the probe block gated oncommand -v docker, the not-installed branch warned "docker is not installed", anddocker_start_hint()suggestedopen -a Docker. So a machine running Podman without the docker shim is fully able to run the container lane (mxcli docker check,project-bin/test-stack-up.sh) and doctor reported it had nothing — and on a team that cannot licence Docker Desktop, that reads as "go install software you are not allowed to have". This PR makes detection and reporting runtime-aware: preferdockerwhen present (including when it is a Podman shim — transparent and correct), fall back topodman, and name the runtime that answered in the output (ok podman responding — …). The bounded background/poll/kill probe and its exit contract (0up ·1down ·2no answer within the bound) are preserved unchanged and now cover Podman too — a stoppedpodman machinestalls exactly like a stopped Docker Desktop, which is what the bound exists for.container_start_hint()suggestspodman machine start(macOS/Windows) orsystemctl --user start podman.socket(Linux/WSL) for the Podman case, and the not-installed warning names both runtimes with Podman as the licence-free option instead of implying Docker Desktop is required.MXTK_CONTAINER_RUNTIME=<name>forces one. Scope is detection and reporting only — how the gate invokes the runtime (mxcli docker check) is mxcli's own code in a different repo and is untouched.--installstill auto-launches Docker Desktop on macOS only; Podman is deliberately left alone, becausepodman machine starton a machine that has never runpodman machine initis not a safe guess to make on someone's behalf. Same defect class as #128: an instrument reporting a problem that does not exist.Field evidence — which real project this ran against / was observed in, and what it measured or fixed there:
No field run. Be clear about this: the authoring container has no working container runtime, so this was NOT executed against real Docker or Podman. Every branch was exercised against fake
docker/podmanbinaries onPATH— daemon up, daemon down, hanging daemon (bound bites), no runtime at all, and podman-only withdockerabsent fromPATH— which proves the control flow and the strings, not the runtimes. The run that would prove it: on a Mac with Podman installed and nodockeronPATH,bin/doctor.shshould reportpodman responding(or apodman machine starthint), where today it reports "docker is not installed". The field data point that motivated it is second-hand and named in the code comment: a colleague's "machine ready" status listed "Docker not installed" as a known issue; they may well have had Podman all along. Driver: the Mendix migration team cannot use Docker Desktop for licensing reasons and is standardising on Podman.CHANGELOG.md)bash -n bin/doctor.shclean;bin/check-portability.shclean (163 files inspected, no new violations); bash 3.2-compatible (no namerefs, nodeclare -A, nomapfile).tests/wave2/test-doctor-docker-probe.shwas not run (CLAUDE.md: scoped testing, ask first) — instead its four scenarios were replicated by hand against the changed script, and every one of its grep strings reproduces verbatim:probing the docker daemon (bounded: 2 s,gave no answer within 2 s,MXTK_DOCKER_PROBE_SECS=30,Then re-run: bin/doctor.sh,daemon is not responding,To start it:,docker daemon responding,docker probe skipped, anddocker daemon respondingcorrectly absent from the hang case. The fixture only ever puts a fakedockeronPATH, so detection resolves todockerand the label isdocker daemon— its assumptions are intact. A maintainer run ofbash tests/wave2/test-doctor-docker-probe.sh bin/doctor.shwould confirm that mechanically; CI runs it anyway.PLATFORM(macos/gitbash →podman machine start; linux/wsl →podman.socket), and no new external tool is invoked beyond<runtime> infoCHANGELOG.mdline appended in this PR, crediting the team's Docker Desktop licensing constraintAlso touched:
project-bin/_common.sh— one comment line, the stale cross-reference tobin/doctor.sh'sdocker_daemon_up(nowcontainer_daemon_up). No behaviour.Noticed, deliberately not changed: the
--no-dockerflag, theMXTK_DOCTOR_SKIP_DOCKER/MXTK_DOCKER_PROBE_SECSenv names and the "docker probe skipped" message keep their docker-shaped spelling — renaming them is a compatibility break for existing callers and fixture assertions, for no reporting benefit.mxcli docker checkandproject-bin/test-stack-up.shstill assume adockerCLI; whether they work under bare Podman is a separate question in a separate repo, and this PR does not claim they do.🤖 Generated with Claude Code
https://claude.ai/code/session_0187r9bQWkZAEppyEqrDevjK
Generated by Claude Code