pub struct ComposeRunCommand {Show 18 fields
pub executor: CommandExecutor,
pub config: ComposeConfig,
pub service: String,
pub command: Vec<String>,
pub detach: bool,
pub rm: bool,
pub no_deps: bool,
pub no_tty: bool,
pub interactive: bool,
pub entrypoint: Option<String>,
pub env: HashMap<String, String>,
pub labels: HashMap<String, String>,
pub name: Option<String>,
pub publish: Vec<String>,
pub user: Option<String>,
pub workdir: Option<String>,
pub volumes: Vec<String>,
pub volume_rm: bool,
}
Expand description
Docker Compose run command builder
Fields§
§executor: CommandExecutor
Base command executor
config: ComposeConfig
Base compose configuration
service: String
Service to run
command: Vec<String>
Command and arguments to run
detach: bool
Run container in background
rm: bool
Automatically remove the container when it exits
no_deps: bool
Don’t start linked services
no_tty: bool
Disable pseudo-TTY allocation
interactive: bool
Keep STDIN open even if not attached
entrypoint: Option<String>
Override the entrypoint
env: HashMap<String, String>
Set environment variables
labels: HashMap<String, String>
Add or override labels
name: Option<String>
Container name
publish: Vec<String>
Publish container ports to host
user: Option<String>
Run as specified user
workdir: Option<String>
Working directory inside the container
volumes: Vec<String>
Bind mount volumes
volume_rm: bool
Remove associated volumes when container is removed
Implementations§
Source§impl ComposeRunCommand
impl ComposeRunCommand
Sourcepub fn interactive(self) -> Self
pub fn interactive(self) -> Self
Keep STDIN open even if not attached
Sourcepub fn entrypoint(self, entrypoint: impl Into<String>) -> Self
pub fn entrypoint(self, entrypoint: impl Into<String>) -> Self
Override the entrypoint
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set an environment variable
Sourcepub fn envs(self, env_vars: HashMap<String, String>) -> Self
pub fn envs(self, env_vars: HashMap<String, String>) -> Self
Set multiple environment variables
Sourcepub fn label(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn label(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add or override a label
Trait Implementations§
Source§impl Clone for ComposeRunCommand
impl Clone for ComposeRunCommand
Source§fn clone(&self) -> ComposeRunCommand
fn clone(&self) -> ComposeRunCommand
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 ComposeCommand for ComposeRunCommand
impl ComposeCommand for ComposeRunCommand
Source§fn get_config(&self) -> &ComposeConfig
fn get_config(&self) -> &ComposeConfig
Get the compose configuration
Source§fn get_config_mut(&mut self) -> &mut ComposeConfig
fn get_config_mut(&mut self) -> &mut ComposeConfig
Get mutable compose configuration for builder pattern
Source§fn subcommand(&self) -> &'static str
fn subcommand(&self) -> &'static str
Get the compose subcommand name (e.g., “up”, “down”, “ps”)
Source§fn build_subcommand_args(&self) -> Vec<String>
fn build_subcommand_args(&self) -> Vec<String>
Build command-specific arguments (without global compose args)
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build complete command arguments including “compose” and global args
(This provides the implementation for
(This provides the implementation for
DockerCommandV2::build_command_args
)Source§impl Debug for ComposeRunCommand
impl Debug for ComposeRunCommand
Source§impl DockerCommand for ComposeRunCommand
impl DockerCommand for ComposeRunCommand
Source§type Output = ComposeRunResult
type Output = ComposeRunResult
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 ComposeRunCommand
impl RefUnwindSafe for ComposeRunCommand
impl Send for ComposeRunCommand
impl Sync for ComposeRunCommand
impl Unpin for ComposeRunCommand
impl UnwindSafe for ComposeRunCommand
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