Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static void CreateTag(string image, string tag, bool isDryRun)
 {
     DockerHelper.ExecuteCommand("tag", "Failed to create tag", $"{image} {tag}", isDryRun);
 }
Ejemplo n.º 3
0
 public static void LoadImage(string tarFilePath, bool isDryRun)
 {
     DockerHelper.ExecuteCommand("load", "Failed to load image", $"-i {tarFilePath}", isDryRun);
 }
Ejemplo n.º 4
0
 public static void SaveImage(string image, string tarFilePath, bool isDryRun)
 {
     DockerHelper.ExecuteCommand("save", "Failed to save image", $"-o {tarFilePath} {image}", isDryRun);
 }