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); }
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(); }
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); }
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; } }
private static void DefaultOptionsMain(DefaultOptions options) { UserConfig.generateConfigs(options.Dockerimage, options.InstallDir, options.Distroname, options.Version); DockerInterop.DownloadImageUsingDocker(); Wsl.InstallImage(); }