dockerImageExists static method
Indicates whether or not a docker image exists by name
Implementation
static bool dockerImageExists(String name) {
final dockerArgs = [
'image',
'ls',
name,
'--format',
'"{{.Repository}}:{{.Tag}}"'
];
final result = Process.runSync('docker', dockerArgs);
final success = result.exitCode == 0;
final text = result.stdout.toString().trim().replaceAll("\"", "");
final sameName = (text == name);
return success && sameName;
}