Docker Community Forums

Share and learn in the Docker community.

Docker-compose crashing if multiple containers built simultaneously with tty:true set in compose file

Expected behavior

Containers are built with TTY without issue.

Actual behavior

If we attempt to build more than one of our container sets with docker-compose -f docker-compose.yml up at the same time docker-compose seems to hang indefinitely. The behavior seems to be alleviated if we remove tty: true from our docker-compose.yml file, but we need that to keep our containers up.

It should be noted that this behavior was not happening until we downgraded our compose file from version 3 to version 2.4 to support the mem_limit parameter. Things were working previously with the default 1Gb of RAM but recent application changes required that we increase the memory allotted to out containers.


docker-compose -f docker-compose.yml --verbose up provides the following error messages…

 urllib3.connectionpool._make_request: http://localhost:None "POST
 /v1.25/containers/CONTAINERID/start HTTP/1.1" 500 None
 compose.parallel.parallel_execute_iter: Failed: ServiceName(project='CONTAINERNAME',
 Creating CONTAINERNAME ... error

 compose.parallel.feed_queue: Pending: set()
 ERROR: for CONTAINERNAME  Cannot start service SERVICENAME: 
 hcsshim::CreateComputeSystem CONTAINERID: The requested resource is in use.

Here’s our docker-compose.yml file…

version: '2.4'
        image: ""
            - "80"
            - "443"
            - "12345"
        env_file: "{envFile}"
            - "{path1}:C:\\path1"
            - "{path2}:C:\\path2"
            - "{path3}:C:\\path3"
            - "{path4}:C:\\Logs\\logs"
            - "{path5}:C:\\Redis\\heapdir"
        tty: true
        mem_limit: 3221225472
        image: ""
            - "1234"
            - service1

Our hosts are all Windows Server 2016 (1903) virtual machines, 8 cpus, 64 gigs of RAM running on VMware ESXi, 6.5.0

Steps to reproduce the behavior

For us, we simply attempt to kick off multiple Jenkins build jobs at the same time against the same docker host. (which run a powershell script which executes docker-compose -up among other things.)

Final Remarks

Does anyone have any bright ideas? Things to try? Bugs to read? We saw quite a lot of old chatter around docker-compose, windows, and the tty setting causing things to hang but nobody seemed to have any real solutions - just ridiculously dumb things like removing the tty and setting the container timeout to some ridiculous number.