How to increase the size of the /dev/shm in docker container

后端 未结 4 1697
渐次进展
渐次进展 2020-12-14 05:47

Currently When I create new docker container the size of the shared memory directory is limited to 64MB. But, I need to increase this size since my application depend on thi

4条回答
  •  失恋的感觉
    2020-12-14 06:07

    If you're using docker-compose, you can set the your_service.shm_size value if you want your container to use that /dev/shm size when running or your_service.build.shm_size when building.

    Example:

    version: '3.5'
    services:
      your_service:
        build:
          context: .
          shm_size: '2gb' <-- this will set the size when BUILDING
        shm_size: '2gb' <-- when RUNNING 
    

    Link to source.

提交回复
热议问题