Skip to main content

Module docker_inspect_batch

Module docker_inspect_batch 

Source
Expand description

One docker inspect for every container a status query probes (issue #243).

--list used to start one or two docker inspect processes per record (the live state, the process IDs, the removal check), one after another, and --status up to three for its one record. While a query runs, this module asks Docker once for every field those probes read, and answers the per-record docker inspect -f <format> <target> calls from that answer.

Docker prints one line per found container, in argument order, and one No such container: <target> line on stderr per missing one. Each line is matched back to its target by name or ID prefix (Docker’s own lookup order), so the answer does not depend on the line order. A target the batch cannot account for (an old or stubbed docker, a daemon error) is not answered, and its per-record probe runs as before.

Constants§

BATCH_FIELDS
Fields of the batched inspect, in output order.

Functions§

batch_format
The Go template of the batched inspect.
docker_probe_targets
Containers the status probes of these records would inspect. Records whose container is already marked removed are skipped: they are never probed.
parse_batch_inspect
Match a batched inspect answer to its targets; unanswered targets are absent from the result.
prefetched_inspect
Answer docker inspect -f <format> <target> from the batch, or None when the batch has no answer and the probe must run.
with_docker_inspect_batch
Run query with the docker probes of records answered by one inspect. Nested calls reuse the outer answer.

Type Aliases§

BatchAnswers
Answers per target: fields, or None for a target Docker reported missing.
BatchRow
Fields of one found container, keyed by template field.