Skip to main content

Module runtime

Module runtime 

Source
Expand description

Which container runtime this srv talks to (P11 of the container-parity work).

DOCKER_HOST decides when it is set: a unix:// socket, tcp:// or http:// (with TLS when DOCKER_TLS_VERIFY is; without it only to this computer, because the daemon is handed the account’s credentials), https://, or Windows’ npipe://. Anything else (ssh://) is named as unsupported, and nothing else is tried: the person chose a runtime.

When it is not set, the sockets a runtime leaves in the usual places are tried in order and the first that answers a ping is used:

  • Linux: rootless Docker ($XDG_RUNTIME_DIR/docker.sock), rootless Podman ($XDG_RUNTIME_DIR/podman/podman.sock), Docker Desktop (~/.docker/desktop/docker.sock, and ~/.docker/run/docker.sock), the system Docker (/var/run/docker.sock), the system Podman (/run/podman/podman.sock).
  • macOS: Docker Desktop (~/.docker/run/docker.sock), OrbStack (~/.orbstack/run/docker.sock), Colima (~/.colima/default/docker.sock), Rancher Desktop (~/.rd/docker.sock), then the system path.
  • Windows: the docker_engine named pipe, as before.

A socket under the user’s own directories must belong to the user: a planted socket there would see every container request, environment variables included. The system paths are root’s by convention and are not checked.

The answer is either the connection and a label for it (“Podman at unix:///…”), or a Missing that says what was looked at and why each place failed.

Structs§

Candidate
One place to try.
Connected
The runtime in use.
ContainerRuntimeHandle
Self-healing holder for the container runtime connection.
Env
What detection reads from the machine, so tests can hand it a folder of fake sockets.
Missing
Nothing answered.
Tried
A place that did not work, and why.

Enums§

Endpoint
Where a runtime listens.
Kind
What a socket belongs to, from where it was found.
Os

Functions§

candidates
Why DOCKER_HOST cannot be used, or the places to try. Err is the sentence for the person.
connect
The first place that answers a ping, connected; or what was looked at.
docker_host_in_use
DOCKER_HOST for the runtime in use, when it is a plain unix socket or TCP address; None when none is connected yet, or the endpoint is a pipe or needs TLS files (the CLI’s own default then applies).