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
Post a Comment