pam limits in docker containers aren't working -


i added in /etc/security/limits.conf in docker container limit max number of user processes user1, when run bash in container under user user1, ulimit -a doesn't reflect limits defined in pam limits file (/etc/security/limits.conf).

how can work?

i've added line session required pam_limits.so /etc/pam.d/common-session, that's not problem.

i start docker container sudo docker run --user=user1 --rm=true <container-name> bash

also, sudo docker run ... --user=user1 ... cmd doesn't apply pam limits, sudo docker run ... --user=root ... su user1 -c 'cmd' does

the /etc/security/limits.conf file read pam infrastructure on boot. docker containers clones of kernel in pristine state after started. means none of inherited initializations of environment apply container. have use 'limit' command directly set process limits.

better way use container limits, unfortunately current version of docker doesn't support limits on number of processes. looks support coming in version 1.6 when comes out, @thajeztah has mentioned.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -