pub async fn exec_command(
client: &DockerClient,
container: &str,
cmd: Vec<&str>,
) -> Result<String, DockerError>Expand description
Execute a command in a running container and capture output
Creates an exec instance, runs the command, and collects stdout/stderr. Returns the combined output as a String.
§Arguments
client- Docker clientcontainer- Container name or IDcmd- Command and arguments to execute
§Example
ⓘ
let output = exec_command(&client, "opencode-cloud", vec!["whoami"]).await?;