예제 #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
        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);
        }
예제 #3
0
파일: Program.cs 프로젝트: simhaonline/wsld
        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;
            }
        }
예제 #4
0
 private static void DefaultOptionsMain(DefaultOptions options)
 {
     UserConfig.generateConfigs(options.Dockerimage, options.InstallDir, options.Distroname, options.Version);
     DockerInterop.DownloadImageUsingDocker();
     Wsl.InstallImage();
 }