pub struct BuilderBuildCommand { /* private fields */ }
Expand description
docker builder build
command - alternative interface to docker build
This is essentially the same as docker build
but accessed through
the builder subcommand interface.
§Example
use docker_wrapper::command::builder::BuilderBuildCommand;
use docker_wrapper::DockerCommand;
let result = BuilderBuildCommand::new(".")
.tag("myapp:latest")
.no_cache()
.execute()
.await?;
if let Some(id) = result.image_id {
println!("Built image: {}", id);
}
Implementations§
Source§impl BuilderBuildCommand
impl BuilderBuildCommand
Sourcepub fn new(context: impl Into<String>) -> Self
pub fn new(context: impl Into<String>) -> Self
Create a new builder build command
§Arguments
context
- Build context path (e.g., “.”, “/path/to/dir”)
Sourcepub fn dockerfile(self, path: impl Into<String>) -> Self
pub fn dockerfile(self, path: impl Into<String>) -> Self
Set the Dockerfile to use
Sourcepub fn build_arg(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn build_arg(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set build-time variables
Trait Implementations§
Source§impl Clone for BuilderBuildCommand
impl Clone for BuilderBuildCommand
Source§fn clone(&self) -> BuilderBuildCommand
fn clone(&self) -> BuilderBuildCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BuilderBuildCommand
impl Debug for BuilderBuildCommand
Source§impl DockerCommand for BuilderBuildCommand
impl DockerCommand for BuilderBuildCommand
Source§type Output = BuildOutput
type Output = BuildOutput
The output type this command produces
Source§fn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Get the command executor for extensibility
Source§fn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Get mutable command executor for extensibility
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the complete command arguments including subcommands
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the command and return the typed output
Source§fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Helper method to execute the command with proper error handling
Source§fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
Add a raw argument to the command (escape hatch)
Auto Trait Implementations§
impl Freeze for BuilderBuildCommand
impl RefUnwindSafe for BuilderBuildCommand
impl Send for BuilderBuildCommand
impl Sync for BuilderBuildCommand
impl Unpin for BuilderBuildCommand
impl UnwindSafe for BuilderBuildCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more