Skip to content

fix(doctor): probe podman too — a Podman machine was reported as "docker is not installed" - #131

Merged
MendixMau merged 2 commits into
masterfrom
claude/doctor-podman-probe
Sep 22, 2026
Merged

MendixMau merged 2 commits into
masterfrom
claude/doctor-podman-probe

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Direct lane (bin/)

What changed and why (one paragraph):

bin/doctor.sh advertised Podman in its advice text — "Rancher Desktop or Podman (docker-CLI compatible) and colima (macOS) are common substitutes" — while every probe in the section ran docker only: docker_daemon_up() ran docker info, the probe block gated on command -v docker, the not-installed branch warned "docker is not installed", and docker_start_hint() suggested open -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: prefer docker when present (including when it is a Podman shim — transparent and correct), fall back to podman, and name the runtime that answered in the output (ok podman responding — …). The bounded background/poll/kill probe and its exit contract (0 up · 1 down · 2 no answer within the bound) are preserved unchanged and now cover Podman too — a stopped podman machine stalls exactly like a stopped Docker Desktop, which is what the bound exists for. container_start_hint() suggests podman machine start (macOS/Windows) or systemctl --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. --install still auto-launches Docker Desktop on macOS only; Podman is deliberately left alone, because podman machine start on a machine that has never run podman machine init is 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/podman binaries on PATH — daemon up, daemon down, hanging daemon (bound bites), no runtime at all, and podman-only with docker absent from PATH — which proves the control flow and the strings, not the runtimes. The run that would prove it: on a Mac with Podman installed and no docker on PATH, bin/doctor.sh should report podman responding (or a podman machine start hint), 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.

  • No client data anywhere in the diff
  • Size cap: 3 files, ~99 insertions / ~50 deletions (1 line of it CHANGELOG.md)
  • Test tier reached: T0/T1bash -n bin/doctor.sh clean; bin/check-portability.sh clean (163 files inspected, no new violations); bash 3.2-compatible (no namerefs, no declare -A, no mapfile). tests/wave2/test-doctor-docker-probe.sh was 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, and docker daemon responding correctly absent from the hang case. The fixture only ever puts a fake docker on PATH, so detection resolves to docker and the label is docker daemon — its assumptions are intact. A maintainer run of bash tests/wave2/test-doctor-docker-probe.sh bin/doctor.sh would confirm that mechanically; CI runs it anyway.
  • For a changed instrument: both layouts irrelevant here (no path resolution touched); both platforms considered — the Podman start hint branches on PLATFORM (macos/gitbash → podman machine start; linux/wsl → podman.socket), and no new external tool is invoked beyond <runtime> info
  • CHANGELOG.md line appended in this PR, crediting the team's Docker Desktop licensing constraint
  • No new bug entries or skills in this PR

Also touched: project-bin/_common.sh — one comment line, the stale cross-reference to bin/doctor.sh's docker_daemon_up (now container_daemon_up). No behaviour.

Noticed, deliberately not changed: the --no-docker flag, the MXTK_DOCTOR_SKIP_DOCKER / MXTK_DOCKER_PROBE_SECS env 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 check and project-bin/test-stack-up.sh still assume a docker CLI; 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

…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
@MendixMau
MendixMau merged commit aa7ccbd into master Sep 22, 2026
1 check 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.

2 participants