Module pull

Module pull 

Source
Expand description

Docker Pull Command Implementation

This module provides a comprehensive implementation of the docker pull command, supporting all native Docker pull options for downloading images from registries.

§Examples

§Basic Usage

use docker_wrapper::PullCommand;
use docker_wrapper::DockerCommand;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Basic pull of an image
    let pull_cmd = PullCommand::new("nginx:latest");
    let output = pull_cmd.execute().await?;
    println!("Pull completed: {}", output.success);
    Ok(())
}

§Advanced Usage

use docker_wrapper::PullCommand;
use docker_wrapper::DockerCommand;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Pull all tags for a repository
    let pull_cmd = PullCommand::new("alpine")
        .all_tags()
        .platform("linux/amd64")
        .quiet();

    let output = pull_cmd.execute().await?;
    println!("All tags pulled: {}", output.success);
    Ok(())
}

Structs§

PullCommand
Docker Pull Command Builder