Exemple #1
0
        public static int DownloadImage( )
        {
            var layers = HttpRequests.AskForLayers();

            Console.WriteLine("Image with " + layers.Count() + " layers");
            Console.WriteLine("Downloading...");

            for (int i = 0; i < layers.Count(); ++i)
            {
                var layer = layers.ElementAt(i);
                Fops.WriteToFileAppend(HttpRequests.DownloadLayer(layer["digest"].ToString()), UserConfig.w_tmp_rootfs_path);
                Console.WriteLine("Downloaded " + (i + 1) + " of " + layers.Count());
            }

            Console.WriteLine("Finished! All layers downloaded.");
            return(layers.Count());
        }