Containers

See Docker and Podman when they are usable.

Inventory containers from runtimes available to the current user, flag socket or group permission problems, and run bounded start/stop/restart actions with the same plan-then-confirm flow as services.

Quick start

shell
lens-containers
lens-containers --once
lens-containers --runtime docker --state running
lens-containers --json

Run without flags for the interactive list. Select a container and press Enter to inspect runtime, id, name, image, status, normalized state, created time and published ports.

Reading container state

Runtimedocker, podman, or nerdctl for the manager that reported the row.
Id / nameFull container id and primary name used for unique action targeting.
ImageImage reference reported by the runtime.
StatusHuman status string such as Up 2 hours or Exited (0) 3 days ago.
StateNormalized lifecycle value for filters and asserts: running, exited, created, paused and similar.
Created / portsCreated timestamp when exposed, plus published ports as one display string.

Presence and permissions

Collection is optional per runtime. If docker, podman, or nerdctl is not installed, or the daemon is not live, that runtime contributes no rows and no warning. If the tools are installed and live but the current user cannot access the socket or lacks the usual admin group, Lens records a clear collection_warnings entry and still returns any rows it can read.

Multiple runtimes may appear in one snapshot. Lens never merges rows across runtimes that share a name.

Interaction

/ j kMove through containers
EnterInspect the selected container
aOpen the start/stop/restart action menu
/Search the container list
rRefresh container state
!Open a diagnostic shell beside the live view
EscReturn from detail or cancel an overlay
qQuit

Start, stop or restart a container

Select a container and press a. Choose start, stop or restart, review the exact runtime and target, then press y to execute. The same operations are available to scripts:

shell
# Review a scriptable plan; no state change
lens-containers --action restart --name edge-mqtt --match exact --dry-run

# Execute after explicit non-interactive confirmation
lens-containers --action start --name metrics-agent --match exact --expect-status running --yes

Selectors must resolve to exactly one container. The operation runs as the invoking user, has a 15-second deadline and is never retried automatically. After execution, --expect-status can wait for the desired state (default wait 2s).

Filters and output

--runtime RUNTIMERestrict to docker, podman, or nerdctl.
--name NAMEMatch name or id; pair with --match exact for a unique target.
--image IMAGEMatch the image reference.
--status TEXTMatch the human status string.
--state STATEMatch normalized state such as running or exited.
--fail-if-emptyExit 3 when no rows match after filters.
--plain / --json / --jsonlOne-shot formats for scripts; --fields containers projects JSON.

If container data is incomplete

An empty list with no warning usually means no usable Docker/Podman/nerdctl runtime is installed or live for this user. An empty or partial list with a warning means the tools exist but access failed. Process-level container hints from cgroups remain available in lens-top.