public (Architecture Arch, string?Variant) GetImageArch(string image, bool isDryRun) { string archAndVariant = DockerHelper.ExecuteCommand( "inspect", "Failed to retrieve image architecture", $"-f \"{{{{ .Architecture }}}}/{{{{ .Variant }}}}\" {image}", isDryRun); string[] parts = archAndVariant.Split('/', StringSplitOptions.RemoveEmptyEntries); Architecture arch = Enum.Parse <Architecture>(parts[0], ignoreCase: true); string? variant = parts.Length > 1 ? parts[1] : null; return(arch, variant); }
public static void CreateTag(string image, string tag, bool isDryRun) { DockerHelper.ExecuteCommand("tag", "Failed to create tag", $"{image} {tag}", isDryRun); }
public static void LoadImage(string tarFilePath, bool isDryRun) { DockerHelper.ExecuteCommand("load", "Failed to load image", $"-i {tarFilePath}", isDryRun); }
public static void SaveImage(string image, string tarFilePath, bool isDryRun) { DockerHelper.ExecuteCommand("save", "Failed to save image", $"-o {tarFilePath} {image}", isDryRun); }