torrust_tracker_deployer_lib/adapters/docker/mod.rs
1//! Docker CLI client for executing Docker commands
2//!
3//! This module provides a `DockerClient` that wraps Docker CLI operations using our
4//! `CommandExecutor` abstraction. This enables testability and consistency with other
5//! external tool clients (Ansible, `OpenTofu`, LXD).
6//!
7//! # Architecture
8//!
9//! - `client.rs` - Main Docker client with one method per Docker subcommand
10//! - `error.rs` - Docker-specific error types with actionable messages
11//!
12//! # Example
13//!
14//! ```rust,no_run
15//! use torrust_tracker_deployer_lib::adapters::docker::DockerClient;
16//!
17//! # fn example() -> Result<(), Box<dyn std::error::Error>> {
18//! let docker = DockerClient::new();
19//!
20//! // Build a Docker image
21//! docker.build_image("docker/ssh-server", "my-app", "latest")?;
22//!
23//! // Check if image exists
24//! let exists = docker.image_exists("my-app", "latest")?;
25//! assert!(exists);
26//!
27//! // List all containers
28//! let containers = docker.list_containers(true)?;
29//! # Ok(())
30//! # }
31//! ```
32
33pub mod client;
34pub mod error;
35
36pub use client::DockerClient;
37pub use error::DockerError;