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§
- Image
Info - Represents a Docker image from the output
- Images
Command - Docker Images Command Builder
- Images
Output - Output from the images command with parsed image information