MCPcopy Create free account
hub / github.com/Qovery/engine / docker_exec

Function docker_exec

lib-engine/src/cmd/docker.rs:1013–1035  ·  view source on GitHub ↗
(
    args: &[&str],
    envs: &[(&str, &str)],
    stdout_output: &mut F,
    stderr_output: &mut X,
    cmd_killer: &CommandKiller,
)

Source from the content-addressed store, hash-verified

1011}
1012
1013fn docker_exec<F, X>(
1014 args: &[&str],
1015 envs: &[(&str, &str)],
1016 stdout_output: &mut F,
1017 stderr_output: &mut X,
1018 cmd_killer: &CommandKiller,
1019) -> Result<(), DockerError>
1020where
1021 F: FnMut(String),
1022 X: FnMut(String),
1023{
1024 let mut cmd = QoveryCommand::new("docker", args, envs);
1025 cmd.set_kill_grace_period(Duration::from_secs(0));
1026 let ret = cmd.exec_with_abort(stdout_output, stderr_output, cmd_killer);
1027
1028 match ret {
1029 Ok(_) => Ok(()),
1030 Err(CommandError::TimeoutError(msg)) => Err(DockerError::Timeout { raw_error_message: msg }),
1031 Err(CommandError::Killed(msg)) => Err(DockerError::Aborted { raw_error_message: msg }),
1032 Err(CommandError::ExitStatusError(err)) => Err(DockerError::ExitStatusError { exit_status: err }),
1033 Err(CommandError::ExecutionError(err)) => Err(DockerError::ExecutionError { raw_error: err }),
1034 }
1035}
1036
1037// start a local registry to run this test
1038// docker run --rm -ti -p 5000:5000 --name registry registry:2

Callers 12

dropMethod · 0.85
newMethod · 0.85
spawn_builderMethod · 0.85
loginMethod · 0.85
pullMethod · 0.85
build_with_buildkitMethod · 0.85
pushMethod · 0.85
tagMethod · 0.85
create_manifestMethod · 0.85

Calls 2

set_kill_grace_periodMethod · 0.80
exec_with_abortMethod · 0.45

Tested by

no test coverage detected