Skip to content

Repository files navigation

WSL Container Wrapper

A wrapper for the wslc.exe command.

Offers a stronly typed interface to generate commands to manage containers on Windows.

Usage

Reference the WslcWrapper.csproj from the git repo or use the NuGet package SilentOrbit.WSLC.

Sample

//Get list of images
List<ImageListItem> list = new ImageList().RunJson();

//Create a container from one of the images
var containerID = new ContainerCreate(image: list[0])
{
    Name = "Hello",
    RM = true, //--rm: Remove the container after it stops
}.RunID();

//Start the new container
var resp = new ContainerStart(containerID).Run();

//Inspect the results
Console.WriteLine($"Result: {resp.ExitCode}");
Console.WriteLine($"Output: {resp.StdOut}");
Console.Error.WriteLine($"Error: {resp.StdErr}");

About

Wrapper for wslc.exe - the WSL Container (Windows Subsystem for Linux)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages