Expand description
Docker command implementations.
This module contains all Docker CLI command wrappers. Each command is implemented as a struct with a builder pattern API.
§The DockerCommand Trait
All commands implement DockerCommand, which provides:
execute()- Run the command and get typed outputarg()/args()- Add raw CLI argumentswith_timeout()- Set execution timeout
§Example
use docker_wrapper::{DockerCommand, RunCommand};
let container = RunCommand::new("nginx:alpine")
.name("web")
.port(8080, 80)
.detach()
.execute()
.await?;
println!("Started container: {}", container.short());§Extensibility
For options not yet implemented, use the escape hatch methods:
use docker_wrapper::{DockerCommand, RunCommand};
let mut cmd = RunCommand::new("nginx");
cmd.arg("--some-new-flag")
.args(["--option", "value"]);
cmd.execute().await?;Modules§
- attach
- Docker attach command implementation.
- bake
- Docker Bake Command Implementation
- build
- Docker build command implementation.
- builder
- Docker builder and buildx commands
- commit
- Docker commit command implementation.
- compose
- Docker Compose command implementations using the unified trait pattern.
- container_
prune - Docker container prune command implementation.
- context
- Docker context management commands
- cp
- Docker cp command implementation.
- create
- Docker create command implementation.
- diff
- Docker diff command implementation.
- events
- Docker events command implementation.
- exec
- Docker exec command implementation.
- export
- Docker export command implementation.
- generic
- Generic Docker command for executing any Docker CLI command.
- history
- Docker history command implementation.
- image_
prune - Docker image prune command implementation.
- images
- Docker Images Command Implementation
- import
- Docker import command implementation.
- info
- Docker info command implementation
- init
- Docker init command implementation
- inspect
- Docker inspect command implementation.
- kill
- Docker kill command implementation.
- load
- Docker load command implementation.
- login
- Docker login command implementation
- logout
- Docker logout command implementation
- logs
- Docker logs command implementation.
- manifest
- Docker manifest command implementations.
- network
- Docker network management commands.
- pause
- Docker pause command implementation.
- port
- Docker port command implementation.
- ps
- Docker ps command implementation.
- pull
- Docker Pull Command Implementation
- push
- Docker Push Command Implementation
- rename
- Docker rename command implementation.
- restart
- Docker restart command implementation.
- rm
- Docker rm command implementation.
- rmi
- Docker rmi command implementation.
- run
- Docker run command implementation.
- save
- Docker save command implementation.
- search
- Docker search command implementation
- start
- Docker start command implementation.
- stats
- Docker stats command implementation.
- stop
- Docker stop command implementation.
- swarm
- Docker Swarm command implementations.
- system
- Docker system management commands.
- tag
- Docker tag command implementation.
- top
- Docker top command implementation.
- unpause
- Docker unpause command implementation.
- update
- Docker update command implementation.
- version
- Docker version command implementation
- volume
- Docker volume management commands.
- wait
- Docker wait command implementation.
Structs§
- Command
Executor - Common functionality for executing Docker commands
- Command
Output - Output from executing a Docker command
- Compose
Config - Base configuration for all compose commands
- Environment
Builder - Helper for building environment variables
- Port
Builder - Helper for building port mappings
- Port
Mapping - Port mapping configuration
Enums§
- Ansi
Mode - ANSI control character mode
- Progress
Type - Progress output type for compose commands
- Protocol
- Network protocol for port mappings
Constants§
- DEFAULT_
COMMAND_ TIMEOUT - Default timeout for command execution (30 seconds)
Traits§
- Compose
Command - Extended trait for Docker Compose commands
- Docker
Command - Unified trait for all Docker commands (both regular and compose)