lmrc-docker 0.3.16

Docker client library for the LMRC Stack - ergonomic fluent APIs for containers, images, networks, volumes, and registry management
Documentation
//! 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(())
}