示例#1
0
        static bool DockerBuild(string[] args)
        {
            string firstArg = args.Length > 0 ? args[0] : "";

            Parser.Default.ParseArguments <DockerfileOptions>(args).WithParsed(options => {
                UserConfig.generateConfigs("wsld/wsld_dockerfile:image", "", options.Distroname, 0);
                UserConfig.dockerfile_path = options.Dockerfile;

                Console.WriteLine("Building image...");


                if (DockerInterop.BuildDockerfile(options.remote))
                {
                    Console.WriteLine("Image created correctly... installing...");
                }
                else
                {
                    Console.WriteLine("Image generation failed...");
                }
                DockerInterop.DownloadImageUsingDocker();
                Wsl.InstallImage();
            });

            return(true);
        }
示例#2
0
文件: Docker.cs 项目: jayd2446/wsld
 public static void InstallWsldImage()
 {
     Console.WriteLine("WSLD Image will be installed.");
     Console.WriteLine("This image is needed to perform all the operations of this tool");
     Console.WriteLine("Touching the contents of the image is not recommended.");
     UserConfig.generateConfigs("rucadi/wsld:wsld", "", "wsld", 0);
     DownloadImage();
     File.Move(UserConfig.w_tmp_rootfs_path, UserConfig.w_rootfs_path);
     Wsl.InstallImage();
 }
示例#3
0
        static bool DockerUpload(string[] args)
        {
            string firstArg = args.Length > 0 ? args[0] : "";

            Parser.Default.ParseArguments <DockerUploadOptions>(args).WithParsed(options => {
                UserConfig.generateConfigs(options.Dockerimage, "", options.Distroname, 0);

                Console.WriteLine(DockerInterop.wslToDockerHub());
            });

            return(true);
        }
示例#4
0
        private static void DefaultOptionsMain(DefaultOptions options)
        {
            UserConfig.setImageUserPasswordConfig(options.User, options.Password, options.CreateUser);
            UserConfig.generateConfigs(options.Dockerimage, options.InstallDir, options.Distroname, options.Version);
            DockerInterop.DownloadImageUsingDocker();
            Wsl.InstallImage();


            if (UserConfig.createUser)
            {
                Console.WriteLine("If needed, install sudo with the root user loading the distro with: ");
                var bgc = Console.BackgroundColor;
                Console.BackgroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("wsl -d " + options.Distroname + " -u root");
                Console.BackgroundColor = bgc;
            }
        }
示例#5
0
 private static void DefaultOptionsMain(DefaultOptions options)
 {
     UserConfig.generateConfigs(options.Dockerimage, options.InstallDir, options.Distroname, options.Version);
     DockerInterop.DownloadImageUsingDocker();
     Wsl.InstallImage();
 }