Memory limit in version 3 compose files without using swarm

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?

1 Like

@pharring - have you managed to find an answer?

Nope. Still looking for a solution.

According to this issue, the recommended way to use docker-compose is by using version 2.x files

Which does not work when I want to publish single ports to the host network which I need to do to get the original IP of a request.

Circling around here.