0

I am trying to run a windows background process in docker. The process is very memory intensive, and I am still developing it. How can I increase the memory of my container? I am continuously getting out of memory exceptions.

I am using Visual Studio 2017 and cannot find a way in the docker-compose file to specify memory settings.

 version: '3.4'

services:
  topshelfcws:
    image: ${DOCKER_REGISTRY}topshelfcws
    build:
        context: .\TopShelfCWS
        dockerfile: Dockerfile
    deploy:
       resources:
          limits:
            memory: 4GB

seems to have no effect

After further investigation, seems this is outputted from VS upon running docker-compose

Some services (topshelfcws) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use docker stack deploy to deploy to a swarm.

JCircio
  • 525
  • 2
  • 7
  • 18

2 Answers2

0

Try adding

deploy:
      resources:
        limits:
          memory: 10000000MB

in your compose file, AFAIK the default for HyperV based containers is 1GB.

Uku Loskit
  • 40,868
  • 9
  • 92
  • 93
0

Well, since 3.x version of docker-compose there is another mechanism for memory limiting instead of 2.x version due to adjusting 3.x to docker-swarm. If you don't use docker-swarm old-styled (2.x) will not work in 3.x format file, unless you check --compatibility flag, but be aware, it's not production way.

You can find all needed information in related question here

Egor Popov
  • 458
  • 4
  • 12