April 2017
Beginner
404 pages
9h 30m
English
The following code shows how to get containers. The containerslistparameters contains properties for filtering the list of containers based on size, number, before/since a particular container ID and using custom filters.
/// <summary> /// Lists all the containers running on a host /// </summary> /// <param name="limit">Limit number of containers</param> /// <returns>A list of containers</returns> private async static Task<IList<ContainerListResponse>> ListContainers(int limit = 10) { client = new DockerClientConfiguration(new Uri(containerHostUrl)).CreateClient(); var containers = await client.Containers. ListContainersAsync(new ContainersListParameters() { Limit = limit, Size = true, All = true }); return ...Read now
Unlock full access