April 2017
Beginner
404 pages
9h 30m
English
The following method stops a container, and we can configure a lead time before killing the container:
/// <summary> /// Stop a container by Container Id /// </summary> /// <param name="id">Container Id</param> private async static Task<bool> StopContainer(string id) { client = new DockerClientConfiguration (new Uri(containerHostUrl)).CreateClient(); return await client.Containers.StopContainerAsync (id, new ContainerStopParameters() { WaitBeforeKillSeconds = 10 }, default(CancellationToken)); }
Read now
Unlock full access