docker-wrapper
A comprehensive, type-safe Docker CLI wrapper for Rust applications.
Features
- Complete Docker CLI coverage (35+ commands)
- Type-safe builder pattern API
- Async/await support with Tokio
- Real-time output streaming
- Docker Compose support (optional)
- Zero unsafe code
- Extensive test coverage
Installation
[]
= "0.2"
= { = "1", = ["full"] }
Enable Docker Compose support:
[]
= { = "0.2", = ["compose"] }
Quick Start
use ;
async
When to Use docker-wrapper
docker-wrapper is ideal for:
- CLI tools and automation scripts - Familiar Docker CLI behavior
- Docker Compose workflows - Native compose command support
- Development tools - Container management for dev environments
- Shell script migration - Type-safe Rust alternative to bash scripts
- Cross-platform support - Works with Docker, Podman, Colima, etc.
Choosing between Docker Rust libraries? See our comprehensive Comparison Guide comparing docker-wrapper vs bollard vs testcontainers-rs.
Documentation
For comprehensive documentation, examples, and API reference:
- API Documentation - Complete API reference with examples
- Examples - Working examples for common use cases
- Comparison Guide - docker-wrapper vs other Docker Rust libraries
- Command Coverage - Docker CLI command implementation status
- GitHub Repository - Source code and issue tracking
Examples
The examples/
directory contains practical examples:
basic_usage.rs
- Common Docker operationscontainer_lifecycle.rs
- Container managementstreaming.rs
- Real-time output streamingdocker_compose.rs
- Docker Compose usage (requirescompose
feature)error_handling.rs
- Error handling patterns
Run examples:
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
License
Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).