//! Image building example
//!
//! This example shows how to build a Docker image from a Dockerfile

use lmrc_docker::{DockerClient, Result};
use std::path::Path;

#[tokio::main]
async fn main() -> Result<()> {
    // Create a Docker client
    let client = DockerClient::new()?;

    println!("Building Docker image...");

    // Build an image
    let tag = client
        .images()
        .build("my-app:latest")
        .dockerfile("Dockerfile")
        .context(Path::new("."))
        .build_arg("VERSION", "1.0.0")
        .label("maintainer", "your.email@example.com")
        .execute()
        .await?;

    println!("✓ Image built successfully: {}", tag);

    Ok(())
}
