custom entrypoint with ulimit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mauro Torrez 2019-10-12 10:25:22 -03:00
parent cc267252f6
commit fcee0594d4
3 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,7 @@ RUN apt-get update \
ADD setup /start.d ADD setup /start.d
ADD confd /etc/confd/ ADD confd /etc/confd/
ADD entrypoint.sh /
EXPOSE 389 EXPOSE 389

6
entrypoint.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
/usr/local/bin/confd -onetime -backend env
run-parts -v /start.d
ulimit -n 1024
exec ${@}

2
setup
View File

@ -4,7 +4,7 @@ assert(){ [[ $? -eq 0 ]] || { [[ -n ${1} ]] && echo ${@} ; exit 1 ; } }
# from https://github.com/dinkel/docker-openldap/blob/master/entrypoint.sh: # from https://github.com/dinkel/docker-openldap/blob/master/entrypoint.sh:
# When not limiting the open file descritors limit, the memory consumption of # When not limiting the open file descritors limit, the memory consumption of
# slapd is absurdly high. See https://github.com/docker/docker/issues/8231 # slapd is absurdly high. See https://github.com/docker/docker/issues/8231
ulimit -n 8192 ulimit -n 1024
chown -R openldap:openldap /var/lib/ldap chown -R openldap:openldap /var/lib/ldap
assert "FATAL: could not set required directory permissions" assert "FATAL: could not set required directory permissions"