Docker Community Forums

Share and learn in the Docker community.

Memory limit in version 3 compose files without using swarm

(Pharring) #1

I’m using Docker for Windows version 17.06.2-ce-win27 (13194) Channel:stable in Windows container mode.
My containers default to 1GB total memory and I’d like to increase that.

In Compose file version 2, one can specify mem_limit to control the amount of memory in the container and that seems to work. Running docker-compose up with the following compose file shows an “Available Physical Memory” of 3583MB

version: '2.1'
    image: microsoft/windowsservercore
    command: systeminfo
    mem_limit: 3G

However, according to the docs, in Compose file version 3, mem_limit has been replaced by deploy: resources: limits: memory. That implies docker swarm mode which, for my current project, I don’t want.

Is there a way to get the effect of mem_limit in a version 3 compose file but without using docker swarm?

(Heroin62134) #2

@pharring - have you managed to find an answer?

(Pharring) #3

Nope. Still looking for a solution.