Expand description
Docker Push Command Implementation
This module provides a comprehensive implementation of the docker push
command,
supporting all native Docker push options for uploading images to registries.
§Examples
§Basic Usage
use docker_wrapper::PushCommand;
use docker_wrapper::DockerCommand;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Basic push of an image
let push_cmd = PushCommand::new("myapp:latest");
let output = push_cmd.execute().await?;
println!("Push completed: {}", output.success);
Ok(())
}
§Advanced Usage
use docker_wrapper::PushCommand;
use docker_wrapper::DockerCommand;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Push all tags for a repository
let push_cmd = PushCommand::new("myregistry.com/myapp")
.all_tags()
.platform("linux/amd64")
.quiet()
.disable_content_trust();
let output = push_cmd.execute().await?;
println!("All tags pushed: {}", output.success);
Ok(())
}
Structs§
- Push
Command - Docker Push Command Builder