0

I've run into a problem with Docker for Windows and can't find any helpful answers searching the web.

I found https://stackoverflow.com/questions/21799382/is-there-a-maximum-number-of-containers-running-on-a-docker-host/21801470 to which the answer boils down to "the limit is set by the system resources".

Either this doesn't apply on a Windows system or - more likely - I don't know the limit I'm running up against.

I have a Docker image based on microsoft/dotnet:2.1-aspnetcore-runtime, created as Linux container and supposed to be running on Docker for Windows on a Win 10 Pro machine (during development).

I can start multiple containers of this image and they all work as supposed. However I'm not able to start more than the afore mentioned 64 containers using

docker run -d -v C:\Users\Public\Documents\DockerShare:/app/SharedData dockerImage:latest

I started out with a 10GB limit for Docker and already increased it to 16GB, but to no avail. Also the 64 machines runnig a kestrel server only account for a 1.8GB (when idle, as they are right after being started) of memory used.

Another touching point is a share that each of the containers mounts when started.

I also checked https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file but there doesn't seem to be a property to limit the number of containers in there.

UPDATE

I have tried the same on an Ubuntu 18.04.2 LTS with the same result. Once I reach the start of container #65 the container immediately exits with code 139. The volume is of course changed to a linux path like

docker run -d -v ~/DockerShare:/app/SharedData dockerImage:latest
0

It seems that I found the solution.

After upgrading all our services to ASPNET Core 2.2 I went through the code to check for any hard links to previous donet core versions and found the following lines in the Startup.cs file

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
    //                                                                    ====
    //                                                                      ^
    //                                                                      |   
    [...]
}

After replacing _2_1 with _2_2 and rebuilding the container I was able to start 100 containers without any issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.