Container¶
Methods
Start()Stop(Signal signal, TimeSpan timeout)Delete(DeleteContainerOption options)ConnectNetwork(ContainerNetwork network)DisconnectNetwork(hstring nameOrId)CreateProcess(ProcessSettings newProcessSettings)Inspect()Id()InitProcess()State()Close()
Behavior notes
Start()automatically setsWSLC_CONTAINER_START_FLAG_ATTACHif an init process exists and its output mode isEventorStream.Stop()converts the timeout to seconds, rejects negative values, and rejects values that exceeduint32_t.InitProcess()throws if the container was not configured with one.ConnectNetwork()andDisconnectNetwork()work on created or running containers. The network may be referenced by name, full ID, or unique ID prefix.ConnectNetwork()throws ifnetworkis null;DisconnectNetwork()throws ifnameOrIdis empty.ConnectNetwork()andDisconnectNetwork()require WSL 3.1.0 or later and throwWSLC_E_RUNTIME_UPDATE_NEEDEDon older runtimes.
Examples