Skip to main content

container_list_command

Function container_list_command 

Source
pub fn container_list_command(runtime: Option<ContainerRuntime>) -> String
Expand description

Build the SSH command string for listing containers. Output is the container NDJSON, then the ##purple:engine## sentinel, then the daemon version on its own line. The version subcall is suffixed with || true so its failure cannot mask a docker ps error: the chain surfaces ps’s exit code, while a missing version line just yields engine_version: None downstream.

  • Some(Docker) / Some(Podman): direct listing for the known runtime.
  • None: combined detection + listing with sentinel markers in one SSH call.