stopContainer function

Future<String> stopContainer({
  1. required String containerID,
})

Stop a container

Implementation

Future<String> stopContainer({
  required String containerID,
})async{
  List<String> argumentsList = [
    'stop',
    containerID,
  ];
  ProcessResult result = await Process.run(
    dockerCommand,
    argumentsList,
    runInShell: true,
  );
  if(result.exitCode == 0){
    return result.stdout;
  }else{
    throw result.stderr;
  }
}