#42 new: docker logs

This commit is contained in:
lollipopkit
2023-05-18 22:06:12 +08:00
parent a9fa981e96
commit 472599498e
16 changed files with 178 additions and 127 deletions

View File

@@ -163,6 +163,14 @@ class DockerProvider extends BusyProvider {
return null;
}
Future<String> logs(String id) async {
setBusyState();
final cmd = _wrap('docker logs $id');
final result = await client!.run(cmd);
setBusyState(false);
return result.string;
}
// judge whether to use DOCKER_HOST / sudo
String _wrap(String cmd) {
final dockerHost = dockerStore.getDockerHost(hostId!);