Skip to main content

Module docker

Module docker 

Source
Expand description

The Docker-compatible engines this computer has: each CLI context with an engine behind it, whether its daemon answers, which one the CLI uses, and pointing the CLI at another (docker context use). Every call is the Docker CLI’s, through the Context’s runner.

A daemon that gives no answer says why (NoAnswer): no CLI, refused to this account (its socket’s or named pipe’s permission: joining a group helps, starting the engine doesn’t), stopped, or an empty answer. An installed engine that doesn’t answer is started as its user would start it (start_engine).

Structs§

EngineStatus
One Docker-compatible engine found on this computer: the CLI context that reaches it, whether its daemon answers, and whether it is the CLI’s current context.

Enums§

ContextError
Why an engine’s context couldn’t be found or used.
Engine
A Docker-compatible engine.
NoAnswer
Why the Docker daemon gave no answer.
StartFailed
Why an engine wasn’t started.

Constants§

AGREEMENT_GRACE
How long Docker Desktop, opened, is given to show its window before its agreement, not accepted yet, is said to wait for its user (StartFailed::AgreementNotAccepted).
DESKTOP_BACKEND_GRACE
How long Docker Desktop, opened, is given to start its backend (its socket listening: crate::host::Devices::docker_desktop_socket) before it is taken to wait for its user.
START_POLL
How long between two of those asks.
START_TRIES
How many times a started engine is asked whether it answers, START_POLL apart: three minutes in all.

Functions§

agreement_accepted
Whether this computer’s Docker Desktop user has accepted its agreement, from its settings (crate::host::Devices::docker_desktop_settings): None when Docker Desktop has written no settings yet (never started) or they don’t read as JSON.
daemon_info
docker info --format <field> ({{.ServerVersion}}, say), of the daemon context reaches (the current one when None): the daemon answers this account. Docker 26 and older (Debian’s docker.io) exit 0 from docker info when the daemon doesn’t answer, saying so on standard error alone with an empty line on standard output: an empty answer is asked again of docker version, which fails with the reason (not running, or refused to this account).
daemon_os
The current daemon’s operating system line (docker info’s {{.OperatingSystem}}): it answers this account.
engine_context
The Docker context behind engine on this computer, to run on it (docker --context <name>).
engine_in_use
The engine running, from its daemon’s operating system line (daemon_os) and the CLI’s current context.
engines
Every engine this computer has, one per context that names one or answers: probed one by one with docker --context <c> info, given as long as any probe (Context::probe_timeout, as daemon_os): a stopped engine fails fast, and one waking up (Docker Desktop’s Resource Saver, a cold CLI on Windows) answers within it. A context that answers names its engine from the daemon’s operating system too, so default on a Mac reads as the desktop app behind it; one that doesn’t is known by its name alone. Two contexts to one engine keep the first (the current one first of all). None when the contexts can’t be listed (no Docker CLI).
running_of
The engines whose daemon answers.
says_denied
Whether said (a failed docker call’s) says the daemon refused this account: the socket’s refusal on unix (permission denied … docker.sock, … the docker API, … the Docker daemon socket), or the named pipe’s on Windows (open //./pipe/dockerDesktopLinuxEngine: Access is denied.).
start_engine
Starts engine (start_steps, each line its steps print handed to on_line), points the Docker CLI at it once its context appears, and waits until its daemon answers this account. An engine that runs already (its own context answers) is only pointed at: no step runs.
start_steps
The steps that start engine on os, root steps elevated by elevation (Linux): None when it isn’t one a setup starts there (its user starts it).
use_engine
Points the Docker CLI at engine (docker context use), as its user would in a terminal.