pub struct DockerCompose { /* private fields */ }Expand description
Docker Compose integration using subprocess execution
Implementations§
Source§impl DockerCompose
impl DockerCompose
Sourcepub fn new<P: AsRef<Path>>(compose_file: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(compose_file: P) -> Result<Self>
Create a new Docker Compose instance
Sourcepub fn with_project_name<S: Into<String>>(self, name: S) -> Self
pub fn with_project_name<S: Into<String>>(self, name: S) -> Self
Set a custom project name
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Check if docker-compose is available
Sourcepub fn compose_file(&self) -> &Path
pub fn compose_file(&self) -> &Path
Get the compose file path
Sourcepub fn working_dir(&self) -> &Path
pub fn working_dir(&self) -> &Path
Get the working directory
Sourcepub fn project_name(&self) -> Option<&str>
pub fn project_name(&self) -> Option<&str>
Get the project name
Source§impl DockerCompose
High-level Docker Compose operations
impl DockerCompose
High-level Docker Compose operations
Sourcepub fn up(&self, options: UpOptions) -> Result<ComposeOutput>
pub fn up(&self, options: UpOptions) -> Result<ComposeOutput>
Start services (docker-compose up)
Sourcepub fn down(&self, options: DownOptions) -> Result<ComposeOutput>
pub fn down(&self, options: DownOptions) -> Result<ComposeOutput>
Stop and remove services (docker-compose down)
Sourcepub fn restart(&self, options: RestartOptions) -> Result<ComposeOutput>
pub fn restart(&self, options: RestartOptions) -> Result<ComposeOutput>
Restart services (docker-compose restart)
Sourcepub fn logs(&self, options: LogsOptions) -> Result<ComposeOutput>
pub fn logs(&self, options: LogsOptions) -> Result<ComposeOutput>
View service logs (docker-compose logs)
Sourcepub fn ps(&self, options: PsOptions) -> Result<ComposeOutput>
pub fn ps(&self, options: PsOptions) -> Result<ComposeOutput>
List running services (docker-compose ps)
Sourcepub fn build(&self, options: BuildOptions) -> Result<ComposeOutput>
pub fn build(&self, options: BuildOptions) -> Result<ComposeOutput>
Build services (docker-compose build)
Sourcepub fn start(&self, services: &[String]) -> Result<ComposeOutput>
pub fn start(&self, services: &[String]) -> Result<ComposeOutput>
Start services (docker-compose start)
Sourcepub fn stop(&self, options: StopOptions) -> Result<ComposeOutput>
pub fn stop(&self, options: StopOptions) -> Result<ComposeOutput>
Stop services (docker-compose stop)
Sourcepub fn exec(
&self,
service: &str,
command: &[String],
options: ExecOptions,
) -> Result<ComposeOutput>
pub fn exec( &self, service: &str, command: &[String], options: ExecOptions, ) -> Result<ComposeOutput>
Execute a command in a service container (docker-compose exec)
Sourcepub fn pull(&self, services: &[String]) -> Result<ComposeOutput>
pub fn pull(&self, services: &[String]) -> Result<ComposeOutput>
Pull service images (docker-compose pull)
Sourcepub fn config(&self, options: ConfigOptions) -> Result<ComposeOutput>
pub fn config(&self, options: ConfigOptions) -> Result<ComposeOutput>
Validate and view the compose configuration (docker-compose config)
Trait Implementations§
Source§impl Clone for DockerCompose
impl Clone for DockerCompose
Source§fn clone(&self) -> DockerCompose
fn clone(&self) -> DockerCompose
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DockerCompose
impl RefUnwindSafe for DockerCompose
impl Send for DockerCompose
impl Sync for DockerCompose
impl Unpin for DockerCompose
impl UnsafeUnpin for DockerCompose
impl UnwindSafe for DockerCompose
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