pub struct Composer {
pub daemon: Docker,
}Expand description
The Composer is responsible for managing the OP-UP docker containers.
Fields§
§daemon: DockerThe Docker daemon client.
Implementations§
Source§impl Composer
impl Composer
Sourcepub async fn list_containers(
&self,
status: Option<&str>,
) -> Result<Vec<ContainerSummary>>
pub async fn list_containers( &self, status: Option<&str>, ) -> Result<Vec<ContainerSummary>>
List all the OP-UP docker containers existing on the host.
The containers are filtered by the label com.docker.compose.project=op-up.
This method allows optional filtering by container status:
created|restarting|running|removing|paused|exited|dead
Sourcepub async fn create_image<T>(
&self,
opts: CreateImageOptions<'_, T>,
) -> Result<String>
pub async fn create_image<T>( &self, opts: CreateImageOptions<'_, T>, ) -> Result<String>
Create a Docker image from the specified options.
Returns the ID of the created image.
Sourcepub async fn build_image(
&self,
name: &str,
dockerfile: &str,
build_context_files: &[(&str, &[u8])],
) -> Result<()>
pub async fn build_image( &self, name: &str, dockerfile: &str, build_context_files: &[(&str, &[u8])], ) -> Result<()>
Build a Docker image from the specified Dockerfile and build context files.
Sourcepub async fn create_volume<T>(
&self,
config: CreateVolumeOptions<T>,
) -> Result<Volume>
pub async fn create_volume<T>( &self, config: CreateVolumeOptions<T>, ) -> Result<Volume>
Creates a Docker volume with the specified options.
Sourcepub async fn create_container(
&self,
name: &str,
config: Config<String>,
overwrite: bool,
) -> Result<ContainerCreateResponse>
pub async fn create_container( &self, name: &str, config: Config<String>, overwrite: bool, ) -> Result<ContainerCreateResponse>
Create a Docker container for the specified OP Stack component
Sourcepub async fn start_container(&self, id: &str) -> Result<()>
pub async fn start_container(&self, id: &str) -> Result<()>
Start the specified OP Stack component container by ID.
Sourcepub async fn stop_container(&self, id: &str) -> Result<()>
pub async fn stop_container(&self, id: &str) -> Result<()>
Stop the specified OP Stack component container by ID.
Sourcepub async fn remove_container(&self, id: &str) -> Result<()>
pub async fn remove_container(&self, id: &str) -> Result<()>
Remove the specified OP Stack component container by ID.
Sourcepub async fn stop_all_containers(&self) -> Result<()>
pub async fn stop_all_containers(&self) -> Result<()>
Stop all OP-UP docker containers at once.
Sourcepub async fn purge_all_containers(&self) -> Result<()>
pub async fn purge_all_containers(&self) -> Result<()>
Remove all OP-UP docker containers at once