Module images

Module images 

Source
Expand description

Docker Images Command Implementation

This module provides a comprehensive implementation of the docker images command, supporting all native Docker images options for listing local images.

§Examples

§Basic Usage

use docker_wrapper::ImagesCommand;
use docker_wrapper::DockerCommand;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // List all images
    let images_cmd = ImagesCommand::new();
    let output = images_cmd.execute().await?;
    println!("Images listed: {}", output.success());
    Ok(())
}

§Advanced Usage

use docker_wrapper::ImagesCommand;
use docker_wrapper::DockerCommand;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // List images with filtering and JSON format
    let images_cmd = ImagesCommand::new()
        .repository("nginx")
        .all()
        .filter("dangling=false")
        .format_json()
        .digests()
        .no_trunc();

    let output = images_cmd.execute().await?;
    println!("Filtered images: {}", output.success());
    Ok(())
}

Structs§

ImageInfo
Represents a Docker image from the output
ImagesCommand
Docker Images Command Builder
ImagesOutput
Output from the images command with parsed image information