Skip to content

fix(standard): use podman when docker is installed but does not answer - #243

Merged
harenome merged 3 commits into
ThinkFlowLab:mainfrom
harenome:fix/engine-fallback
Nov 19, 2026
Merged

harenome merged 3 commits into
ThinkFlowLab:mainfrom
harenome:fix/engine-fallback

Conversation

@harenome

@harenome harenome commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #242

What

One rule in both places: docker, unless docker ps fails and podman ps succeeds. When neither answers, the choice stays as today, docker if it is installed, else podman, so the reason given is unchanged.

  1. This machine (standard/container.py).
    • _answers(program) runs <program> ps with a 10 s limit.
    • engine() asks it only when both programs are on the PATH and docker is not podman under that name. A machine with only one of them makes no call.
    • DOCKER is still chosen once, when the module is imported.
    • The hint in unusable() now says "Nullius uses it when docker does not answer and podman does".
  2. A host (hosts.py). The probe already ran <engine> ps for each engine. Its engine now applies the same rule to docker_ok and podman_ok. A run on the host goes through the standard's own code there, which calls the same engine(), so the probe and the run pick the same engine.
  3. Settings → Sandbox (sandbox.py, settings/sandbox.js, settings/settings.html).
    • docker_state() adds also when both engines are installed: the other one, with its version or the last line of why it does not answer.
    • The page shows it in a row under Engine, hidden when there is no other engine.
    • Podman's own docker script counts as the same program, not as a second engine.

The builder, prerequisites and execution.py read the chosen engine and its _ok and need no change. Harbor recipes still need docker, which is Harbor's own requirement.

Touches

backend (nullius/standard/container.py, nullius/hosts.py, nullius/sandbox.py) · static and templates (settings/sandbox.js, settings/settings.html) · tests · docs (docs/standard.md, the Backends row)

Before and after

Before, on main, Settings → Sandbox shows "✕ docker is installed but not usable by this user: … podman is on this machine: Nullius uses it when docker is not on the PATH", and nothing runs on the container backend.

After, in a preview container with both programs installed:

docker's daemon stopped both answer
after-sandbox-docker-down after-sandbox-both-working

Verified

With stub programs on a PATH that holds nothing else, the same checks on main and on this branch:

Check main this branch
container.engine() docker podman
sandbox.docker_state() ok: False, the docker error ok: True, podman …, also: docker does not answer
prerequisites.check_here(["engine"], standard=True) missing ok
hosts.test engine: docker engine: podman
Where, Test connection "✓ Connected · ✕ docker not usable by this user: this run needs it" "✓ Connected"

A preview with real programs: an app container with docker.io and podman 5.4.2, and two ssh hosts with both, on Fedora's podman image.

  • The app with its docker daemon stopped picks podman. With the daemon running, it picks docker.
  • A host whose user is in the docker group picks docker. A host whose user is not, where docker ps says "permission denied while trying to connect to the docker API", picks podman.
  • Test connection says Connected for both hosts.

In a throwaway rootless python:3.12 container with Node.js and uv:

  • python3 app/tests/parallel.py: 3078 tests in 156 modules, OK.
  • pip install -r app/requirements.txt, then python3 app/tests/parallel.py app/ui_tests: 674 tests in 55 modules, OK.
  • New tests, which fail on main:
    • test_standard_container.py: with both on the PATH, the one that answers is the engine (podman, docker, and docker when neither answers); the host probe and engine() pick the same engine; the Sandbox names the other engine when both are installed, and not podman's docker script; the updated hint.
    • test_hosts.py: the probe's engine for each combination of docker_ok and podman_ok.
    • test_sandbox.py: the engine named with its version is asked with no other engine on the PATH, so a docker installed on the machine running the suite does not change it.

Not checked: a real run through podman in the preview, the docker test tier, and a host reached over a network rather than a local container.

Risk

  • On a machine with both installed, each start runs docker ps, and podman ps when docker fails. Each takes up to 10 s if the engine hangs, for example a DOCKER_HOST that does not answer.
  • The engine is still chosen once per process. Starting or stopping a daemon later takes a restart, as today.
  • To undo, revert the commits.

With both docker and podman on the PATH, the container backend chose docker
by presence alone, so a docker that refuses this user or has no daemon
blocked the standard's container runs even where podman works. The engine
is now docker unless `docker ps` fails and `podman ps` succeeds, on this
machine (container.engine) and in a host's probe (hosts.test) alike, so the
probe and the standard's run there agree. Only a machine with both is asked;
with one engine the choice costs no call. Where neither answers, docker is
kept and its reason is said as before.
@harenome
harenome merged commit 5c918be into ThinkFlowLab:main Nov 19, 2026
2 checks passed
@harenome
harenome deleted the fix/engine-fallback branch November 19, 2026 15:46
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.

Standard: a broken docker beside a working podman stops the container backend

1 participant