Docker Community Forums

Share and learn in the Docker community.

Docker-compose.yml ulimits


(Windofkeltia) #1

Ubuntu 18.04.1 Server
docker-compose version 1.22.0, build f46880fe

I find Docker Compose unable to make use of ulimits/nofile changes that I can effectuate on the Docker command-line proper. From the original Docker command line,

  • docker run --ulimit nofile=65536:65536 -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk

which ran fine, plus Docker Compose documentation for ulimits, I intuit:

elk:
  image: sebp/elk
    ports:
      - "5601:5601"
      - "9200:9200"
      - "9300:9300"
      - "5044:5044"
  ulimits:
    nofile:
      soft: "65536"
      hard: "65536"

But, instead, I get this as soon as I type docker-compose up elk:

The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for ulimits: 'nofile'
elk.image contains an invalid type, it should be a string

What is the proper way to do this?


(Windofkeltia) #2

Oops, my indentation was wrong for ports. It had nothing to do with ulimits. My bad. Sorry.