Home > Mobile >  How to set limits from /etc/security/limits.conf in a Docker container?
How to set limits from /etc/security/limits.conf in a Docker container?

Time:01-26

I have this limits.conf on my virtual machine:

dfyz          soft    nofile            1000000
dfyz          hard    nofile            1000000
* soft core 0
* hard core unlimited
* soft memlock unlimited
* hard memlock unlimited

And I need this in a Docker container. But if I just copy this file to container's /etc/security/limits.conf it doesn't work.

How to set these limits into a Docker container?

CodePudding user response:

According to the answer of David Maze, I used the answer from how to set ulimit / file descriptor on docker container the image tag is phusion/baseimage-docker

docker run --rm -ti --ulimit memlock=100000000000:100000000000 my_image
  • Related