April 2017
Beginner
404 pages
9h 30m
English
The following method creates a container using image microsoft/windowsservercore. CreateContainerParameters provides a lot of options for creating containers like setting up the working directory, Shell, port mappings and so on:
/// <summary> /// Creates a Container /// </summary> private async static Task<CreateContainerResponse> CreateContainer() { client = new DockerClientConfiguration(new Uri(containerHostUrl)).CreateClient(); return await client.Containers.CreateContainerAsync (new CreateContainerParameters() { Image = "microsoft/windowsservercore", Name = "mycontainer", Shell = new List<string> { "CMD" } } ); }
Read now
Unlock full access